Uncategorized

Linux Commands: Essential tools for beginners in the Linux operating system

Essential Linux Commands For Beginners in Linux

Linux is a popular operating system that runs on the command line. It is open source and has many functionalities that work faster than GUI-based applications.

There are several Linux commands that all users should know, including pwd, ls, mkdir, rmdir, and cd. Other useful commands include uname, which prints detailed information about your system.

1. pwd

This command is really useful for beginners in Linux because it shows you where you are in the file system. It shows the full path, starting from root. It also ignores symlinks.

You can personalize it by storing its value in a variable and adding a message to print. See this tutorial for more details.

2. ls

ls is a command that allows you to see the contents of a directory. It displays file permissions, user and group ownership information, number of links, file size, and more.

Hidden files start with a dot (.) and cannot be seen with the normal ls listing. To display these files, use the -a option.

The ls command is feature-rich. Learning just a few of its options will get you far.

3. mkdir

The Linux command line (also known as the shell, terminal, or prompt) is a text interface for your computer. It allows you to type commands and perform tasks using various flags.

The ls command displays the contents of a directory, including files and other nested directories. The mkdir command creates directories. It can have different options, such as -m to set folder permissions.

4. rmdir

rmdir is a command to remove directories from the file system. It is one of the essential Linux commands that every Linux beginner should know.

The rmdir command has different options such as -v, which displays verbose information for each directory, and -ignore-fail-on-non-empty, which avoids reporting failures caused by empty directories. It also supports recursive removal. The -p option displays a help message and exits.

5. cd

The cd command is one of the most important for navigating through a system’s directory structure. It is built into many shells including AmigaOS, DR DOS, IBM OS/2, Linux and Unix.

To change to a parent directory, add two consecutive periods to the command (cd ). To stay in the same relative location, use cd.. (or cd username). The command follows symbolic links too.

6. touch

The touch command is a simple yet useful tool for Linux. It can create an empty file quickly, and it can change the modification or access time of files and directories.

To use the touch command pass a file name to it. Then it will update the access marks and modification time of that file. It will also dereference symlinks to make the changes.

7. cat

The cat command displays the content of files. It can also redirect output using the redirection operator.

Its second role is concatenation (which is the source of its curious name). This occurs only to copies, so there’s no effect on the original files.

The more command is similar to cat, but it shows a screenful of output at a time. You can scroll through it by pressing the ENTER key or the space bar.

8. rm

The rm command removes objects like files, directories, and symbolic links from the file system. It’s important to use rm carefully, as Linux doesn’t have a recycle bin to recover deleted files.

By default, rm prompts for confirmation removal before deleting a file. To disable this minor protection, you can add the -i option. This makes rm delete files silently. The -R option orders rm to travel down into subdirectories recursively.

9. cp

The cp command copies files and directories. It has three primary operating modes based on the type and count of arguments presented to the program upon invocation.

The -p option preserves characteristics of files during copying, including the time of file modification and ownership, plus file permission bits. Symbolic links are followed unless the -R option is used, which excludes them.

10. df

df displays disk space usage statistics for all mounted file systems. It shows used and available space in 1K blocks, the mount point and other details. -a: Prints information of duplicate, pseudo and inaccessible file systems too.

-h: Prints sizes in human-readable format using SI unit suffixes (k for kilobytes, M for megabytes and G for gigabytes). Use -H for powers of 1024.

Drift back to the home page

LEAVE A RESPONSE

Your email address will not be published. Required fields are marked *

Related Posts