Juana  O'Keefe

Juana O'Keefe


Pwd Command in Linux (Current Working Directory)

In this article, we will show you how to determine your current working directory using the pwd command.

What is the Current Working Directory

The current working directory is the directory in which the user is currently working in. Each time you interact with your command prompt, you are working within a directory.

By default, when you log into your Linux system, your current working directory is set to your home directory. To change the working directory use the [cd](https://linuxize.com/post/linux-cd-command/) command.

For example, to change the current working directory to /tmp you would type:

cd /tmp

If you have a customized bash or zsh prompt, the path to the current working directory may be shown in the shell prompt.


pwd Command

The pwd command stands for print working directory. It is one of the most basic and frequently used commands in Linux. When invoked the command prints the complete path of the current working directory.

pwd is a shell builtin in most modern shells such as bash and zsh. Its behavior is slightly different than the standalone /bin/pwd executable. You can use the [type](https://linuxize.com/post/linux-type-command/) command to display all locations containing pwd:

type -a pwd
pwd is a shell builtin
pwd is /bin/pwd

As you can see from the output below, the shell builtin has priority over the standalone executable and it is used whenever you type pwd. If you want to use the standalone pwd binary type the full path to the file /bin/pwd


What is GEEK

Buddha Community

Pwd Command in Linux (Current Working Directory)

I am Developer


How to Delete Directories and Files in Linux using Command Line

In this remove or delete directories and files linux tutorial guide, you will learn how to remove empty directory and non empty directory linux using command line. And as well as how to remove/file files linux using command line.

If you work with Linux then you will need the following:

  • how to remove empty directory in linux,
  • how to remove non empty directory,
  • how to remove directory without confirmation linux
  • how to remove files with and without confirmation in linux.

So, this tutorial guide will show you you how to use the rmunlink, and rmdir commands to remove or delete files and directories in Linux with and without confirmation.


#how to delete directory in linux #how to remove non empty directory in linux #remove all files in a directory linux #linux delete all files in current directory #linux delete all files in a directory recursively #delete all files in a directory linux

Examples of the dig command in Linux

Dig Command Line Options and Examples
Here is the frequently used command line options and example’s of dig command.
1. Basic Dig Command
A basic dig command accept domain name as command line parameter and prints Address record.
2. Query With Specific DNS Server
The default dig command queries to dns server configured on your system. For example, the Linux systems keep default DNS entry in /etc/resolv.conf.
3. Print Short Answer
Use +short command line option to print result in short form. This is basically useful with the shell scripting and other automation tasks.
4. Print Detailed but Specific Result
Use +noall with +answer to print detailed information but specific. This will print only answer section including few more details as a result.

#linux commands #command #dig #dig command #useful examples #linux

Using the mkdir command, you can create directories in Linux

How to Make a New Directory In Linux
To create a directory using the **_mkdir _**command in linux with terminal.
Note : To create a hidden directory, follow our guide on how to show and create hidden files in Linux.
How to Create Multiple Directories with mkdir
If you want to create multiple directory at once command. So, you can use a single mkdir command to create multiple directories at once.
Note that, Do not add any spaces in the curly brackets for the directory names.
How to Make Parent Directories
Note that, you can use ls -R  to display the recursive directory tree in linux. And Without the -p  option, the terminal returns an error if one of the directories in the string does not exist.

#linux #directories #command #mkdir command

Useful Example for the mv command in Linux

mv Command Examples
Below is the basic mv command examples on Linux terminal.

  • Rename file in current directory – For example rename file source.txt to dest.txt in current directory.
  • Move file to destination directory – Move a source.txt file available in current directory to /tmp directory. In above command the file name is unchanged at target directory. You can also rename file name at destination directory just by providing filename at destination.
  • Move file from source directory to destination directory – We can also move files or directory from some other directory to destination directory.
  • Move multiple files to destination at once – The mv accepts multiple source files and move them to the destination directory at once. The following command will move file1.txt, file2.txt in current directory and /opt/file3.txt to the /tmp directory. Here the last command line parameter is used as destination by the mv command.

#linux commands #command #mv #useful example #mv command #linux

date command in Linux with Examples

date Command Examples
Show date time in UTC/GMT
View past dates on specific days
View future dates
View date in other timezone
Print date in specific format
View file modification time

#linux commands #command #date #linux