|
Command |
Explanation |
|
ls |
All the files are listed. |
|
ls -a |
All the files along with the ones whose name begin with .
are also displayed. |
|
ls -l |
All the files along with the details like size, owner, last modification are displayed.
The permissions of all files are also displayed. |
|
cat >file1 |
Creates a file with file name file1. After typing the command with file
name and pressing enter, we can type the contents to be saved in the file. At the
end of the file press Ctrl+D. This will create file1 with the contents
you typed. |
|
cat file1 |
Displays the contents of file1. |
|
cat >>file1 |
Using the command, we can edit the file. |
|
cat file1 file2 >file3 |
A new file file3 containing the contents of both file1 and file2
is created. |
|
mv file1 file2 |
If you want rename a file or directory, you have to use this command. file1
is the old file name and file2 is the new file name. |
|
cp file1 file2 |
Contents from file1 is made with name file2. |
|
cp ~/dir/file1 . |
The contents of the file file1 in the directory dir are copied
to the current directory. Here . denotes the current directory. |
|
mkdir directory1 |
Creates a new directory with name directory1. |
|
rm file1 |
Removes file1. |
|
rm t* |
Removes all the files starting with letter t. |
|
rmdir directory1 |
Removes the directory named directory1. All the files in directory1
must be removed inorder to use this command. |
|
diff file1 file2 |
Compares file1 and file2 and displays where the files are differing. |
|
wc file1 |
The number of characters, words and lines in the file1 are displayed. |
|
cd directory1 |
Changes our current directory in which we are working to directory1. |
|
cd.. |
Changes our directory to the parent directory of the one we are currently in. |
|
pwd |
Displays in which directory we are currently in. |
|
cal |
Displays the current month's calender. |
|
date |
Displays the current time and date. |
|
lpr file1 |
For printing the file1. |
|
man command |
Displays the manual page for given command. |
|
chmod - - - file1 |
For changing Permissions of a file |
|
ftp |
Connects to a remote machine. |
|
telnet |
To log into another machine from our machine. |
|
grep word file1 |
Searches for word in file1 and displays the lines in the file
containing that word. |
|
ls t* |
All the file names starting with letter t are displayed. |
|
more file1 |
For reading files. The entire content in file1 is displayed.
To Read Next Page - Press spacebar
To Read Previous Page - Press b
To Quit - Press q |
|
tail file1 |
Displays the last ten lines in the file file1. |
|
tail -n 15 file1 |
Displays the last fifteen lines in the file file1. |
|
sort file1 |
The contents of the file file1are sorted. |