0% found this document useful (0 votes)
55 views3 pages

Assignment 4 Arya

The document lists and describes 8 basic Linux commands: pwd displays the current working directory path, cd navigates directories, ls lists directory contents, cat displays file contents, mkdir creates new directories, rmdir deletes empty directories, rm deletes directories and contents, and touch creates new blank files. It provides examples of using each command and notes about parameters and directory navigation.

Uploaded by

deepali ghadia
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)
55 views3 pages

Assignment 4 Arya

The document lists and describes 8 basic Linux commands: pwd displays the current working directory path, cd navigates directories, ls lists directory contents, cat displays file contents, mkdir creates new directories, rmdir deletes empty directories, rm deletes directories and contents, and touch creates new blank files. It provides examples of using each command and notes about parameters and directory navigation.

Uploaded by

deepali ghadia
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/ 3

Assignment 4

Some of the basic Commands used in Linux are listed Below:-

1. pwd command: -

Use the pwd command to find out the path of the current working directory (folder) you’re in. The
command will return an absolute (full) path, which is basically a path of all the directories that starts
with a forward slash (/). An example of an absolute path is /home/username.
2. cd command: -

To navigate through the Linux files and directories, use the cd command. It requires either the full
path or the name of the directory, depending on the current working directory that you’re in.

Let’s say you’re in /home/username/Documents and you want to go to Photos, a subdirectory


of Documents. To do so, simply type the following command: cd Photos.

There are some shortcuts to help you navigate quickly:

cd .. (with two dots) to move one directory up

cd to go straight to the home folder

cd- (with a hyphen) to move to your previous directory

On a side note, Linux’s shell is case sensitive. So, you have to type the name’s directory exactly as it
is.

3. ls command: -

The ls command is used to view the contents of a directory. By default, this command will display
the contents of your current working directory.

If you want to see the content of other directories, type ls and then the directory’s path. For
example, enter ls /home/username/Documents to view the content of Documents.

4. cat command: -

cat (short for concatenate) is one of the most frequently used commands in Linux. It is used to list
the contents of a file on the standard output (sdout). To run this command, type cat followed by the
file’s name and its extension. For instance: cat file.txt.

5.mkdir command: -

Use mkdir command to make a new directory — if you type mkdir Music it will create a directory
called Music.

6. rmdir command: -

If you need to delete a directory, use the rmdir command. However, rmdir only allows you to delete
empty directories.

7. rm command: -

The rm command is used to delete directories and the contents within them. If you only want to
delete the directory — as an alternative to rmdir — use rm -r.

Note: Be very careful with this command and double-check which directory you are in. This will
delete everything and there is no undo.

8. touch command: -

The touch command allows you to create a blank new file through the Linux command line. As an
example, enter touch /home/username/Documents/Web.html to create an HTML file
entitled Web under the Documents directory.

You might also like