Site icon TechGit

3 Must Know File and Directory Commands in Linux Ubuntu

Must-know file and directory commands in Linux Ubuntu. These file management commands in Linux can help upu to find home directory in Linux. Use these commands to view the current working directory; home directory in Linux.

Home Directory

A home directory, also called a login directory, is the directory on Unix-like operating systems that serves as the repository for a user’s personal files, directories and programs. It is also the directory that a user is first in after logging into the system. A home directory is created automatically for every ordinary user in the directory called /home. The root directory, which is designated by a forward slash ( / ), is the directory that contains all other directories and their subdirectories as well as all files on the system.

The name of a user’s home directory is by default identical to that of the user.

1. CD Command

The cd command, which stands for “change directory”, changes the shell’s current working directory. It is a builtin command, which means that it is executed directly by your shell, instead of launching an external program. cd is among the commands you will use most often on the command line. To change into the root directory, making it your working directory, use the command “cd /” in terminal. When a directory name is provided, cd changes the current directory to it.

2. PWD Command

‘pwd’ prints the name of the current directory. The command has a simpler format “pwd [OPTION]…” The command accepts various options.

If ‘-L’ and ‘-P’ are both given, the last one takes precedence.

3. LS Command

These options determine which files ‘ls’ lists information for. By default, ‘ls’ lists files and the contents of any directories on the command line, except that in directories it ignores files whose names start with ‘.’.

The ‘ls’ program lists information about files (of any type, including directories). Options and file arguments can be intermixed arbitrarily, as usual.

By default ‘ls’ lists the contents of directories, not recursively, and omitting files with names beginning with ‘.’. For other non-option arguments, by default ‘ls’ lists just the file name. If no argument is specified, ‘ls’ operates on the current directory, acting as if it had been invoked with a single argument of ‘.’.

By default, the output is sorted alphabetically.

3 Must Know File and Directory Commands in Linux Ubuntu originally posted on Source Digit – Latest Technology, Gadgets & Gizmos.

FacebookTwitterTumblrRedditLinkedInHacker NewsDiggBufferGoogle ClassroomThreadsXINGShare
Exit mobile version