Command 1: $ data |
Command display date / time (only admin can change this time / date) |
Command 2: $ cal month year |
Note: Month will be (1 - 12) | Year will be (1 - 9999) Example: $ cal 1998 Display calendar of 1998 $ cal 9 2005 Display calendar of September 2005 $ cal 1752 Basic Year / Starting Year $ cal 9 1752 Basic Year / Starting Year |
Command 3: $ cat > filename |
Used to create a new file Example: $ cat > a1 File is created named a1. |
Command 4: $ cat filename |
Display content of file Example: $ cat a1 Display content of file a1 |
Command 5: $ sort -r filename |
Used for sorting , -r show reverse order sorting Example: $ sort -r a1 (sort by Z to A) Descending order $ sort a1 (sort by A to Z) Ascending order |
Command 6: $ sort a1 > a1 |
Output of a1 redirect to a1 file |
Command 7: $ cat a1 |
Display content of a1 file |
Command 8: $ cat a1 a2 |
Display content of a1 file & a2 file |
| |
Used to copy a1 file to a2 file i.e. (a1=a2) |
Command 10: $ cat a1 a2 > a3 |
Used to copy a1 and a2 into a3 file i.e (a3 = a1 + a2) |
Command 11: $ cat a1 , a2 >> a3 |
Used to append content of a3 file i.e (a3 = a1 + a2 + a3) Example: $ cat a2 , a1 >> a3 $ cat a1 , a2 >> a2 $ cat a1 >> a2 |
Command 12: $ man command name |
Used to show online help Example: $ man who |
Command 13: $ mkdir |
Used for creating new directory. |
Command 14: $ cd directory name |
Used for changing directory. Example: $ cd T3 $ cd . / T3 $ cd / user / jay / T3 $ cd . . / . . / user / jay / T3 $ cd . / jay / T3 $ cd . . / user / jay / T3 $ cd . . /. . /. . / user / jay / T3 $ cd . / . . / jay / T3 Note : All above commands are same regarding changing directory. |
Command 15: $ cp Source file Target file |
Used for copy any file from source directory to destination directory. Example: $ cp / user / jay / T1 / user / jay / T3 / m [OR] $ cp . . / T1 . / m |
Command 16: $ mv Source file Target file |
Used for move or rename file source to target. Example: $ mv / user / jay / T1 / user / jay / T3 / m [OR] $ mv . . / T1 . / T3 / m |
| |
Used for removing directory. Example: $ rmdir T3 |
Command 17: $ rm file(s) |
Used for removing files. Example: $ rm m (It will remove m from jay directory by searching) Note : $ rm * ( For matching with all ) $ rm * . * ( For removing all files ) |
| |
ab* means file name start with ab and end with any. -i If we write -i than it will ask (are you sure [Y , N]) |
Command 20: $ wc -lwc File Name |
Used for forward counting l - Line w - Word c - Char Example: $ wc -lwc ab1 Output like : 5 6 52 ( line=5, word=6, char=52) $ wc -l ab1 Output like : 5 ( line=5) $ wc -wl ab1 Output like : 6 5 ( word=6, line=5) |
No comments:
Post a Comment