Professional Documents
Culture Documents
The default shell prompt for a user is : $ The default prompt for root user is : #
E.g.
$ clear
$ man clear $ passwd
Cal displays a simple calendar. If arguments are not specified, the current month is displayed.
Options
$ cal 16 9 10
E.g.
# date 0920214010.34
Series of folders in the root directory Each of these folders contain important system files When a device such as a USB flash drive or CD/DVD drive is mounted, a folder is created for it under media Absolute Pathnames
Relative Pathnames
Wildcard characters
cd [-L|-P] [dir]
Change the current directory to dir The -P option says to use the physical directory structure The -L option forces symbolic links to be followed
E.g.
$ $ $ $
cd /home/user1 - change to /home/user1 cd s1el cd \ cd / - change to s1el directory - change to the parent directory - change to root directory
ls [OPTION]... [FILE]...
ls List directory
OPTION
-1 List one file per line -X Sort alphabetically -C list entries by columns -i Print the index number of each file -l Long listing format -o Do not list group information -p Append / indicator to directories
E.g.
$ ls -1 -p -X
OPTION
-v Print a message -m Mode
E.g.
$ mkdir S1Elx $ mkdir -v Sem1
OPTION
-v Output a message -p Remove DIRECTORY and its ancestors.
E.g.
$ rmdir Sem1 $ rmdir -v S1El
cp [OPTION]... SOURCE
DEST
OPTION
-i Prompt before overwrite -l Link files instead of copying -R, -r Copy directories recursively -v Display a message
E.g.
$ cp -i file1 file2 $ cp -v /home/user1/mydoc /home/user2/doc2
OPTION
-i Prompt before overwrite -v Display message -f Do not prompt before overwriting
E.g.
$ mv -i -v file1 file2 $ mv -f /home/user1/doc/file1 /home/user1/file2
OPTION
-c Report only when a change is made -R Operate on files and directories recursively -f Suppress most error messages -v Output a diagnostic for every file processed
E.g.
$ chown root /u $ chown root:staff /u
OPTION
-f Suppress most error messages -v Output a diagnostic for every file processed -R Change files and directories recursively
MODE
A combination of the letters ugoa controls which users access to the file will be changed: the user who owns it (u), other users in the files group (g), other users not in the files group (o), or all users (a).
The operator + causes the selected file mode bits to be added to the existing file mode bits of each file; - causes them to be removed; and = causes them to be added The letters rwxXst select file mode bits for the affected users: read (r), write (w), execute (or search for directories) (x), execute/search only if the file is a directory or already has execute permission for some user (X), set user or group ID on execution (s), restricted deletion flag or sticky bit (t).
chmod Example
$ chmod o+r+w+x m.jpeg
OPTION
-n Number all output lines -E Display $ at end of each line -b Number nonempty output lines
E.g.
$ cat -n a.txt b.txt $ cat -E -b a.txt