Found 1383 Articles for Open Source

How to display the current working directory in the Linux system?

Shilpa S
Updated on 06-Sep-2023 13:20:03

36K+ Views

To print the current working directory, we use the pwd command in the Linux system.pwd (print working directory) – The pwd command is used to display the name of the current working directory in the Linux system using the terminal. This is a shell building command that is available in most Unix shells such as Bourne shell, ash, bash, kash, and zsh.SyntaxThe general syntax of the pwd command is as follows −pwd [-LP]A brief description of options available in the pwd command.Sr.No.Option & Description1-L (logical) Display the value of $pwd if it names the current working directory2-P (physical) Display the physical directory, ... Read More

How to list all users who are currently logged into the Linux system?

Shilpa S
Updated on 01-Jul-2021 14:18:31

3K+ Views

To check information about users who are currently logged into the system, we use the who command in the Linux system.The who command is used to display the users logged into the system. The who command related to the w command that is used to display information about the users currently on the machine and their processes.SyntaxThe general syntax of the who command is as follows −who [OPTION]... [ FILE | ARGUMENT1 ARGUMENT2 ]Brief description of options available in the who command.Sr.No.Option & Description1-a, --allSame as -b -d --login -p -r -t -T -u2-b, --bootDisplay last rebooted time of system3-d, ... Read More

How to create links between files in the Linux?

Shilpa S
Updated on 01-Jul-2021 14:16:18

3K+ Views

Before creating links, we need to understand what is link and how many types of link in the Linux system.LinkLinks are shortcuts to access a file. It is a connection between file name and actual data in the system. We can say that a link is a pointer to a file.Types of linksThere are two types of links in the Linux system.Hard LinksSoft Links or Symbolic linksHard Links -The hard link points to the index node of a file, the data of which is stored on the system and the size of link is equal to actual file size.Soft Links ... Read More

How to create key binds in the Linux system using the terminal?

Shilpa S
Updated on 01-Jul-2021 14:11:39

2K+ Views

To set Readline key bindings and variables in the Linux system, we use the bind command.The bind is used to assign functions and macros to a key. It allows to create hotkeys instead of typing the entire command. The bind command available in the shell built-in command.SyntaxThe syntax of the bind command is as follows.bind [-lpsvPSVX] [-m KEYMAP] [-f FILENAME] [-q NAME] [-u NAME] [-r KEYSEQ] [-x KEYSEQ:shell-command]The general syntax of the bind command seems so complicated, but the bind command is simple to use and we can easily create macros.Brief description of options available in the bind command.Sr.No.Option & ... Read More

How to create a new directory in Linux using the terminal?

Shilpa S
Updated on 30-Jun-2021 15:04:43

3K+ Views

The mkdir command is used to create a new directory in the Linux/Unix operating system. It is also used to create more than one directory at a time and set the permission for the directories just like the chmod command in the Linux system.SyntaxThe general syntax of the mkdir command is as follows −$ mkdir [OPTION]... [DIRECTORIES]...Brief description of options available in the mkdir command.Sr.No.Option & Description1-m, --mode=MODESet the mode of file as the time of directory creation just like the chmod command2-p, --parentsNo message prompt if existing and make parent directories as needed3-v, --verbosePrint what is being done4-ZBy default, ... Read More

How to copy a file, group of files, or directory in Linux?

Shilpa S
Updated on 30-Jun-2021 15:02:46

2K+ Views

In this article, we will learn to copy a file or directory in the Linux/Unix operating system using terminal, we use the cp command to copy a file or directory in the Linux system.cp (copy) - The cp command is used to copy files or directories in the Linux system. If we want to copy a file from a source directory and paste it into another destination directory then we have to use the cp command. By default, the cp command will not copy directories to copy directories we have to use -R option with cp command otherwise error will be ... Read More

How to converts tabs to spaces in the Linux system?

Shilpa S
Updated on 30-Jun-2021 15:01:57

3K+ Views

While working with files, sometimes a situation occurs that a file contains many tabs and the requirement is a file in which no tabs but with space. In this case, if a file is quite simple then work is easy but if we are dealing with a long file then it’s very tough work.To convert tabs to spaces, we use the expand command in the Linux system. If file is not given then the expand command read standard input.SyntaxThe general syntax of the expand command as follows −expand [OPTION]... [FILE]...Brief description of options available in the expand command.Sr.No.Option & Description1-i, ... Read More

How to compare two sorted files line by line in the Linux system?

Shilpa S
Updated on 30-Jun-2021 15:01:06

2K+ Views

To compare two sorted files, we use the comm command in the Linux system.The comm command is used to compare two sorted files line by line and writes three columns to standard output. The first two columns contain lines unique to the first and the second file and the last column contains lines common to both. Columns are distinguished with the tab. The functionality of the comm command is similar to the diff command.SyntaxThe general syntax of the comm command is as follows −comm [OPTION]... FILE1 FILE2Brief description of options available in the comm command.Sr.No.Option & Description1-1Suppress first column (lines ... Read More

How to check total space and available space in Linux using the terminal?

Shilpa S
Updated on 30-Jun-2021 15:00:20

678 Views

In the Linux/Unix system to check storage details, we use the df command.df (disk free) command the df command is used to report file system disk space usage using the terminal in the Linux system. It displays total space, used space, and available space.SyntaxThe general syntax of the df command is as follow:$ df [OPTION]... [FILE]...Brief description of options available in the df command.Sr.No.Option & Description1-a, --allInclude duplicate, pseudo, inaccessible file systems2-B, --block-size=SIZEScale sizes before printing3-h, --human-readableDisplay sizes in powers of 10244-H, --siDisplay sizes in powers of 10005-l, --localLimit listing to local file systems6--no-syncDon’t synchronize before getting usage info7--syncSynchronize before getting ... Read More

How to change the shell working directory in Linux?

Shilpa S
Updated on 30-Jun-2021 14:59:31

1K+ Views

To change the shell working directory, we use the cd command in the Linux system.cd (change directory) The cd command used to change the current working directory in the Linux/Unix operating system. In the Windows operating system for the same purpose the cd or chdir command available. The cd command also available in the EFI shell (Extensible Firmware Shell). By default, the current shell working directory is home directory.SyntaxThe general syntax of the cd command is as follows −cd [-L| [-P [-e]] [-@]] [directory]A brief description of options available in the cd command.Sr.No.Option & Description1-LForce soft links to as followedResolve symbolic ... Read More

Advertisements