Roll No: 553


To Study Basic And Advance Commands in Linux

Aim: To study basic and advanced commands in linux.



Create the DIRECTORY(ies), if they do not already exist.
Mandatory arguments to long options are mandatory for short options too.
-m, mode=MODE set permission mode (as in chmod), not rwxrwxrwx - umask
-p, parents no error if existing, make parent directories as needed
-v, verbose print a message for each created directory
-help display this help and exit
-version output version information and exit

2) cd - change directories :

Use cd to change directories. Type cd followed by the name of a directory to access that
directory. Keep in mind that you are always in a directory and can navigate to directories
hierarchically above or below

3) mv- change the name of a directory :
Type mv followed by the current name of a directory and the new name of the directory. Ex: mv
testdir newnamedir

4) ls - Short listing of directory contentsL :

-a list hidden files
-d list the name of the current directory
-F show directories with a trailing '/'
executable files with a trailing '*'
-g show group ownership of file in long listing
-i print the inode number of each file
-l long listing giving details about files and directories
-R list all subdirectories encountered
-t sort by time modified instead of name

5) cp - Copy files :
cp myfile yourfile
Copy the files "myfile" to the file "yourfile" in the current working directory. This command will
create the file "yourfile" if it doesn't exist. It will normally overwrite it without warning if it

cp -i myfile yourfile
With the "-i" option, if the file "yourfile" exists, you will be prompted before it is overwritten.

cp -i /data/myfile
Copy the file "/data/myfile" to the current working directory and name it "myfile". Prompt
before overwriting the file.

cp -dpr srcdir destdir
Copy all files from the directory "srcdir" to the directory "destdir" preserving links (-poption),
file attributes (-p option), and copy recursively (-r option). With these options, a directory and
all it contents can be copied to another dir

6) cal month year :
Prints a calendar for the specified month of the specified year.
7) locate :
Secure Locate provides a secure way to index and quickly search for files on your system. It uses
incremental encoding to compress its database to make searching faster, but it will also store
file permissions and ownership so that users will not see files they do not have access to.
Although locate can be used to create databases to your design, at this stage you will probably
only need to use locate to find files.
8) cd :

Use the cd command to change to another directory.
The syntax is cd followed by the name of the directory you want to go to.
Example: cd /home/user/www will change the directory you are in to /home/user/www

9) find path -name pattern -print :

Searches the specified path for files with names matching the specified pattern (usually
enclosed in single quotes) and prints their names. The find command has many other
arguments and functions; see the online documentation.

10) mail :
Launches a simple mail client that permits sending and receiving email messages.

Conclusion: Thus the basic linux commands are studied and executed.