Difference between revisions of "BasicLinuxCommands"
Athar Hameed (talk | contribs) |
Arif Iqbal (talk | contribs) (format changes) |
||
| Line 2: | Line 2: | ||
* ls (list directory contents) | * ls (list directory contents) | ||
| − | + | ls -l (verbose directory listing) | |
| − | + | ls -ltrh (verbose directory listing, sorted in reverse order (r) according to time (t), file sizes displayed in human-readable format (h)) | |
* cat (concatenate files and print on standard output) | * cat (concatenate files and print on standard output) | ||
| − | + | cat file_name (view the contents of file_name) | |
| − | + | cat file1 file2 ... (concatenate file1 and file2 and print on standard output) | |
* mkdir dir_name (make a directory called dir_name) | * mkdir dir_name (make a directory called dir_name) | ||
| Line 14: | Line 14: | ||
* rm file_name (remove (delete) file_name) | * rm file_name (remove (delete) file_name) | ||
| − | + | rm -f file_name (force delete file_name) | |
| − | + | rm -rf * (force delete all files and directories) | |
* cp file_name copy_file_name (copies file_name to copy_file_name) | * cp file_name copy_file_name (copies file_name to copy_file_name) | ||
| − | + | cp -R * dest (copies all files and directories in the current working directory to a destination directory) | |
* pwd (print name of current working directory) | * pwd (print name of current working directory) | ||
Revision as of 04:50, 15 August 2007
There are some of the basic shell commands that you will need.
- ls (list directory contents)
ls -l (verbose directory listing) ls -ltrh (verbose directory listing, sorted in reverse order (r) according to time (t), file sizes displayed in human-readable format (h))
- cat (concatenate files and print on standard output)
cat file_name (view the contents of file_name) cat file1 file2 ... (concatenate file1 and file2 and print on standard output)
- mkdir dir_name (make a directory called dir_name)
- rmdir dir_name (remove directory dir_name. dir_name must be empty)
- rm file_name (remove (delete) file_name)
rm -f file_name (force delete file_name) rm -rf * (force delete all files and directories)
- cp file_name copy_file_name (copies file_name to copy_file_name)
cp -R * dest (copies all files and directories in the current working directory to a destination directory)
- pwd (print name of current working directory)
