You are on page 1of 3

mkdir Command

The mkdir command is used to create a new directory under any directory.

Syntax:

1. mkdir <directory name>

chdir :-
The cd command, also known as chdir (change directory), is a
command-line shell command used to change the current working
directory in various operating systems. It can be used in shell
scripts and batch files.
• Syntax. #include <unistd.h> int chdir(const char *path);

cat Command

The cat command is a multi-purpose utility in the Linux system. It can be used to create
a file, display content of the file, copy the content of one file to another file, and more.

Syntax:

1. cat [OPTION]... [FILE]..

To create a file, execute it as follows:

1. cat > <file name>


2. // Enter file content

4. ls Command

The ls command is used to display a list of content of a directory.

Syntax:
1. ls

chown command is used to change the file Owner or group. Whenever you
want to change ownership you can use chown command.
Syntax:
chown [OPTION]… [OWNER][:[GROUP]] FILE…
chown [OPTION]… –reference=RFILE FILE…
Example: To change owner of the file:
chown owner_name file_name

In Unix-like operating systems, the chmod command is used to change the


access mode of a file.
The name is an abbreviation of change mode.
Syntax :
chmod [reference][operator][mode] file...

chgrp command in Linux is used to change the group ownership of a file or


directory. All files in Linux belong to an owner and a group. You can set the
owner by using “chown” command, and the group by the “chgrp” command.
Syntax:
chgrp [OPTION]… GROUP FILE…
chgrp [OPTION]… –reference=RFILE FILE…
Note: First we need to have administrator permission to add or delete
groups. We can Login as root for this purpose or using sudo. In order to add
a new group we can use:
sudo addgroup geeksforgeeks

Linux provides us a utility called ps for viewing information related with the
processes on a system which stands as abbreviation for “Process
Status”. ps command is used to list the currently running processes and
their PIDs along with some other information depends on different options.
It reads the process information from the virtual files in /proc file-system.
/proc contains virtual files, this is the reason it’s referred as a virtual file
system.
ps provides numerous options for manipulating the output according to our
need.
Syntax –

ps [options]
Options for ps Command :

1. Simple process selection : Shows the processes for the current


shell

You might also like