Skip to main content

Command Palette

Search for a command to run...

A beginner's guide to the Linux command line

Updated
3 min read
A beginner's guide to the Linux command line
J

I am excited to continue my learning journey in DevOps. I believe that DevOps is the future of software development, and I am excited to be a part of the movement.

#90DaysOfDevOps

Linux commands for everyday use

As you know Linux is a popular operating system that is used by a large cross-section of audiences including IT managers, system engineers, and network engineers. There are many distributions, or distros, of Linux.

Linux is a powerful and versatile operating system that is used by millions of people around the world. Whether you are a beginner or an advanced user, this guide will provide you with a comprehensive list of Linux commands that you can use to interact with your system.

Basic Commands

pwd

pwd (print working directory) displays the current directory you are in.

pwd

cd

cd (change directory) is used to navigate between directories.

cd /path/to/directory

ls

ls (list) displays the contents of a directory.

ls

mkdir

mkdir (make directory) creates a new directory.

mkdir directory_name

rmdir

rmdir (remove directory) removes an empty directory.

rmdir directory_name

rm

rm (remove) removes files or directories.

rm file_namerm -r directory_name

File Management

touch

touch creates a new empty file.

touch file_name

cp

cp (copy) copies files or directories.

cp file_name /path/to/directorycp -r directory_name /path/to/directory

mv

mv (move) moves or renames files or directories.

mv file_name /path/to/directorymv old_file_name new_file_name

cat

cat (concatenate) displays the contents of a file.

cat file_name

head

head displays the first few lines of a file.

head file_name

tail

tail displays the last few lines of a file.

tail file_name

System Information

uname

uname (Unix name) displays system information.

uname -a

df

df (disk free) displays disk space usage.

df -h

free

free displays system memory usage.

free -m

top

top displays real-time system resource usage.

top

User Management

useradd

useradd adds a new user.

useradd username

passwd

passwd sets a password for a user.

passwd username

su

su (switch user) allows you to switch to another user.

su username

sudo

sudo (superuser do) allows you to execute commands as the superuser.

sudo command
sudo apt update
sudo apt install virtualbox

Network Management

ifconfig

ifconfig (interface configuration) displays network interface information.

ifconfig

ping

ping sends a packet to a network host to test connectivity.

ping google.com
ping ip_address

netstat

netstat (network statistics) displays network connections.

netstat -a

ssh

ssh (secure shell) connects to a remote system.

ssh jatin@legion

Conclusion

This guide provides an overview of some of the most commonly used Linux commands. However, there are many more commands available that you can use to interact with your system. To learn more, you can search for detailed information about each command by typing man command_name in the terminal.

More from this blog

Jatin Chourasia

49 posts

Goes by the name LegionDev