List of 51 Linux Commands for …

ekta tripati - sayyad

Linux is a top-rated platform on the internet. Linux is a free and open-source operating system, meaning anyone can use, modify, and distribute it without cost or restrictions.

It powers many devices and systems, including personal computers, servers, supercomputers, smartphones (Android), and embedded devices.

As per the stats, nearly 97% of websites on the internet use Linux servers and 55.9% of professional developers depend upon Linux for their professional needs.

Next,

Linux also has shortcuts! Yes, you heard it right.

Those shortcuts help to end the task quickly. Linux consists of commands and one or two words that perform various operations in no time. In this article, we will mention the handpicked list of Linux Commands.

So, it’s time to hit the road!

Linux commands provide you control over the system from the command line interface (CLI) instead of using a mouse or trackpad. They are text instructions written into the terminal to inform your system exactly what to do.

The commands you mentioned on the Linux terminal are case–sensitive and follow a syntax like “command — options arguments.” You can combine those commands for complex tasks using pipelines and redirection.

Check below a few key things to understand the Linux Commands:

  • Case sensitive
  • Follow particular syntax
  • They are combined for complex operations using pipelines and redirection.
  • You get fine–grained control over your system, which is hard to get over with graphical interfaces.
  • You can automate tasks via shell scripts and batch processing.
  • You can use it to operate system resources like the file system, network, memory, and CPU.
  • You can form the basis of interaction with Linux servers and operating systems.

If you’re a programmer and want to learn coding then you start practicing Linux commands without leaving Windows using the Windows Subsystem for Linux.

You can operate Linux within Windows without dual booting and get the best of both operating systems.

This is a common task on the Linux command line.

Syntax: ls [options] [directory]

Options in ls:

ls -l: Shows detailed information about files and directories, including permissions, owner, size, and modification date.

ls -a: Shows hidden files (those starting with a dot).

Syntax: cd [directory]

Options:

cd ~: Goes to your home directory.

cd ..: Goes up one directory level.

cd ~/pictures — Allow to move into the pictures folder in the home directory of the user you currently logged in with.

Syntax: mkdir [options] <directory>

Options:

mkdir -p: Creates parent directories if they don’t exist.

Syntax: rmdir [options] <directory>

Options:

-v: Verbose output when deleting directories

-p: Remove main directories recursively as per need.

Syntax: cp [options] source destination

Options:

cp -r: Copies directories recursively (including all subdirectories and files).

Syntax: cp -r /home/user/documents /backups/

Syntax: mv [options] source destination

Options:

-i: Check before overwriting any existing files at the destination location. This eliminates overwriting of data mistakenly done.

-v: Outgrow verbose output displays each file or directory as it’s moved. This is useful for approving the exact moved file.

Syntax: rm [options] name

Options:

rm -r: Deletes directories recursively (use with caution!).

rm -f: Forces deletion without prompting for confirmation.

Syntax: cat (older file name) > (newer file name)

Options:

–show-all, -A: It is the same as -vET.

–number-nonblank, -b: It tells the total non-empty output lines. Also, it overrides -n.

-e: It is the same as -vE.

–show-ends, -E: It displays the $ symbol after all lines.

Syntax: less [option] [name or location of the file]

Options:

-E — It auto exits at the end of the file.

-f — It forces non–regular files to be opened

-F — Exit if the entire file can be shown on the first screen

-g — Showcase the string that was found by the last search command.

Syntax: head [option] file_name

Options:

-n — display a specific number of lines

-c — display a specific number of bytes

-v — display the file name tag

-q — avoid separating the content of various files with a file name tag

Syntax: tail [+ -[number] [lbcr] ] [file]

Options:

-l, -b or -c

Syntax: find [path] [criteria]

Options:

-type f — Look for only normal files, eliminate directories.

-mtime +30 — Look for the file’s modification over 30 days ago.

-user jane — Look for files belonging to user “jane.”

syntax: du [options] [path]

Options:

-h — Shows file sizes in a readable way to humans in a format like K for Kilobytes rather than a byte count.

-s — Only display the total size for a directory, rather than listing each subdirectory and file.

-a — Highlight solo file sizes in addition to totals. Useful to locate large files.

Syntax: touch [options] file_name

Options

-a — alter the access time only

-c — file creation is suppressed if the file doesn’t exist

-d — Sets access and modification times with the help of specified STRING.

-m — changes modification time

-r — uses the access and modification times from the reference file

Syntax: chmod permission filename

Read More: List of 51 Linux Commands for Beginners

Source link

You May Also Like