Linux Commands That Are Basic

A application called Linux Shell is also known as CLI (Command Line Interface). It executes commands given by the operating system user and, if there is any, shows the results.

The server and minimal versions of Linux employ a command line interface, although many distributions feature a GUI (graphical user interface).

Let’s try to examine some commands that will aid in our command-line proficiency for Linux.

When we first enter the terminal, we can see something like:


if you are logged in as a privileged user root;


if you are logged in as a user with normal rights.

When you first open a terminal, you are in the user’s home folder. To find out which folder you are currently in, you can use the pwd command :

root@server:~# pwd

To change the directory, use the cd command :

root@server:~# cd /tmp

You can also change to the directory above or to the root directory using the commands:

root@server:~# cd ..

will return you to the previous directory;

root@server:~# cd /

will go to the root of the file system.

To see the contents of a directory, use the ls command :

root@server:~# ls

Using the ls command with the -a option will show hidden :

root@server:~# ls -a

Hidden files start with “.”

The touch command is used to create an empty file :

root@server:~# touch readme.txt

If we want to create a file with some content, we can use the echo command :

root@server:~# echo Hello,my name is Linus >> readme.txt

This line will create a readme.txt file containing the string Hello,my name is Linus.

To view the contents of a file, use the cat command :

root@server:~# cat readme.txt
Hello,my name is Linus

You can also use the following commands to view files:

more – pagination of content;
less – the same, but with the ability to scroll up and down;
head – will show the first ten lines of the file;
tail will show the last ten lines.

You may also need to create a directory, for which there is the mkdir command :

root@server:~# mkdir backups

The rmdir command is used to remove a directory . It will remove the directory if it is empty:

root@server:~# rmdir backups

To recursively delete directories and files in them, use the rm command :

root@server:~# rm -rf backups

deletes the backups directory, all files and directories in it;

root@server:~# rm readme.txt

will delete the readme.txt file.

To copy files, use the cp command . In the cp format “what to copy”-“where to copy”:

root@server:~# cp readme.txt backups

To move a file, use the mv command :

root@server:~# mv readme.txt backups

You can also rename the file with this command:

root@server:~# mv readme.txt readme.old

Sudo (substitute user and do) is a utility that allows you to run commands on behalf of another user:

root@server:~$ sudo -i

It will launch Shell as root. Sudo is used when you need to run a command as root:

root@server:~$ sudo nano /etc//sshd_config

This line will open the sshd_config file with administrator rights in the nano text editor.

Tasks may also arise when it is necessary to change the owner of a file. In this case, the chown command will come to the rescue :

root@server:~# chown -R www-data:www-data /var/www/html/

This line will recursively change the owner and group of the /var/www/html/ directory to www-data.

If it is necessary to change the permissions on files and directories, we can use the chmod utility :

root@server:~# chmod -R 755 /var/www/html/*

It will recursively assign permissions 755 to everything in the /var/www/html/ directory.

Using a more complex construction, you can assign permissions to files and directories separately:

root@server:~#chmod 755 $(find /var/www/html/ -type d)
root@server:~#chmod 640 $(find /var/www/html/ -type f)

For each command, you can use the –help argument to get more detailed information on its use:

root@server:~#cp --help
Usage: cp [OPTION]... [-T] SOURCE DEST
Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.

Also, the man command will always come to the rescue .
More detailed instructions on the requested command can be found as follows:

root@server:~#man ls
LS(1) User Commands LS(1)

ls - list directory contents

ls [OPTION]... [FILE]...

List information about the FILEs (the current directory by default).
Sort entries alphabetically if none of -cftuvSUX nor --sort is speci‐


Welcome to the world of DomainRooster, where roosters (and hens) rule the roost! We're a one-stop shop for all your entrepreneurial needs, bringing together domain names and website hosting, and all the tools you need to bring your ideas to life. With our help, you'll soar to new heights and hatch great success. Think of us as your trusty sidekick, always there to lend a wing and help you navigate the sometimes-complex world of domain names and web hosting. Our team of roosters are experts in their fields and are always on hand to answer any questions and provide guidance. So why wait? Sign up today and join the ranks of the world's greatest entrepreneurs. With DomainRooster, the sky's the limit! And remember, as the saying goes, "Successful people do what unsuccessful people are not willing to do." So don't be afraid to take that leap of faith - DomainRooster is here to help you reach for the stars. Caw on!