|
35. How Do I locate a file?
whereis <filename>
36. How Do I Copy?
cp Copy a file.
cp -i Copy a file and ask before overwriting.
cp -r Copy a directory with its contents.
37. Move/Renaming?
mv Move or rename a file.
mv -i Move or rename a file and ask before overwriting.
38. Remove?
rm -rf /* (dont really do /* because It will remove everything!)
rm Remove a file.
rm -r Remove a directory with its contents.
rm -i Ask before removing a file. Good to use with the -r option.
39. Make and Remove?
mkdir Make a directory.
rmdir Remove an empty directory
40. PWD
pwd "Print working directory" - show what dir you're in.
41. LS
ls List the contents of a dir.
ls -l List the contents of a dir and show additional info of the files.
ls -a List all files, including hidden files.
42. CD
cd Change directory.
cd .. Go to the parent directory.
43. Cat
Cat is a simple little program that displays the contents of a text file when you give the file name as an argument to it:
$ cat view_this
less is a program that lets you view text files, like cat does, but if the files are so long that they don't fit on your screen, less automatically paginates the file. You use less by giving the file name as an argument to it:
$ less view_this
You can also open several files at the same time so you can navigate from one file to next without closing it first. If you want to open several files, just give all the file names at once:
$ less file1 file2 file3
When viewing several files at the same time, you can use :n for examining the next file and :P for the previous file.
Here are some, but absolutely not all, of the commands you can use in less:
Command / key Action
e, j, Down, or Enter - move forward one line
y, k, or Up - move backward one line
f, Space, or Page - Down move forward one page
b, or Page Up - move backward one page
/characters - search forward in the file for lines containing the specified characters
n - repeat the previous search
:e file_name - examine a new file
:n - examine the next file
:P - examine the previous file
h, or ? - display help
q - quit
44. Off the subject lil bit:
Planning account creation
You should make sure to provide user accounts with only the minimal requirements for the task they need to do. If you provide your secretary, or another general user, with an account, you might want them to only have access to a word processor or drawing program, but be unable to delete data that is not his or hers.
Several good rules of thumb when allowing other people legitimate access to your Linux machine:
* Limit access privileges given to new users.
* Be aware when/where they login from, or should be logging in from.
* Make sure to remove inactive accounts
* The use of the same user-ID on all computers and networks is advisable to ease account maintenance, as well as permit easier analysis of log data (but I'm sure someone will dispute this). However, it's practically essential if using NFS. There are several other protocols that use UIDs for local and remote access as well.
* The creation of group user-IDs should be absolutely prohibited. User accounts also provide accountability, and this is not possible with group accounts.
* Be sure shadow passwords are enabled. Shadow passwords is a method for storing the actual user's password in a root-owned file that is not readable by normal users, unlike the regular password file. This protects the passwords from being read and cracked using dictionary attacks. Most (if not all) current distributions already use shadow passwords.
* Regularly audit user accounts for invalid or unused accounts, expired accounts, etc.
* Check for repeated login failures. The files in /var/log are invaluable resource to track potential security problems.
* Be sure to enable quotas on machines with many users, to prevent denial of service attacks involving filling disk partitions, or appending exploits to group-writable files.
* Disable group accounts, and unused system accounts, such as sys or uucp. These accounts should be locked, and given non-functional shells.
* Many local user accounts that are used in security compromises are ones that have not been used in months or years. Since no one is using them they provide the ideal attack vehicle.
Back on:
45. Permissions
chmod <permission> <file>
Last edited by Unleashed2k; August 26th, 2004 at 8:06 PM..
|