0% found this document useful (0 votes)
107 views1 page

Basic Commands of REDHAT

The document discusses 10 basic commands in RedHat Linux: pwd prints the working directory, ls lists files in a directory, cd changes directories, touch creates empty files, rm removes files, mkdir creates directories, rmdir removes directories, mv moves and renames files/directories, cp copies files/directories, and man displays command manuals. Most commands have additional options that modify their default behaviors.

Uploaded by

imtiyaz beigh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
107 views1 page

Basic Commands of REDHAT

The document discusses 10 basic commands in RedHat Linux: pwd prints the working directory, ls lists files in a directory, cd changes directories, touch creates empty files, rm removes files, mkdir creates directories, rmdir removes directories, mv moves and renames files/directories, cp copies files/directories, and man displays command manuals. Most commands have additional options that modify their default behaviors.

Uploaded by

imtiyaz beigh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Basic Commands of RedHat Linux

The List
1. pwd
The pwd command stands for "print working directory" and will return your location in the file system, such
as /usr/share or /home/matthew. This is useful if you forget where you are.

2. ls
When used alone, the ls command lists all of the files and directories contained in your current directory.
You can also use ls to list the contents of a directory you have not navigated to by adding the directory
location after the command, like this: ls etc/python.

3. cd
The cd command changes your working directory to a directory you specify. For example, cd
/var/log takes you to the log directory that is contained in the var directory.
4. touch
The touch command creates an empty file using the filename you specify. Create a file now and then
use cd to confirm that it was created in your current directory: touch examplefile.

5. rm
The rm command removes a file. To delete the file you just created, enter: rm examplefile.

6. mkdir
The mkdir command creates a directory. Create a directory now and then use cd to confirm that it was
created in your current directory: mkdir exampledirectory.

7. rmdir
The rmdir command removes a directory. To delete the directory you just created, enter: rmdir
exampledirectory.
8. mv
The mv command moves a file or a directory you specify to the location you specify. It is also used to

rename files and directories. You can do both at the same time, if you like. For example, let's move a file
named sample from our current working directory into an existing subdirectory called stuff while changing
the name of the file to example: mv sample stuff/example.

9. cp
The cp command copies a file or directory you specify to the location and new filename you specify. Let's
use the same example: cp sample stuff/example. The difference between what happens here and
what happened with mv is that with cp, the original file remains.

10. man
The man command displays the manual page for the command you specify. Every command I have

mentioned in this short article can do much more than you have learned thus far. In fact, we have just
scratched the surface. Most commands have options, called switches, available to modify the default
behavior. For example, when you enter man ls and view the man page for that command, you will learn
about incredibly useful options like ls -al which will list not only file and directory names, but also very

useful metadata about each file and directory.

You might also like