UNIX
UNIX
Directory Commands
pwd
Displays the full path of the current working directory.
Syntax
pwd
mkdir
mkdir Used for creating directory. A directory is a container for files.
mkdir
Syntax
mkdir directoryname
mkdir world (creating a single directory)
mkdir p directory4/directory5/directory6
mkdir p asia/india/karnataka (Creating an entire directory structure without earlier creating the first directory mentioned. p indicates to put the first directory mentioned forcibly.)
cd
Used to change to a specified directory.
Syntax
cd directoryname cd world (Changes to the specified directory) cd .. (Changes to immediate parent directory) cd ../.. (Changes to parent of the immediate parent directory) cd / (Changes to root directory)
rmdir
Used to remove empty directory.
Syntax rmdir directoryname
rmdir europe (Removing a single empty directory)
rm r directoryname
rm r asia (Removing an entire directory recursively whether it is empty or not)
File Commands
cat
Stands for concatenate(combine) Used for displaying the contents of a file and creating a file.
cat
Syntax
cat > filename
cat > bangalore type some content here and press ctrl and d together to save file (Creating a file)
cat
Syntax
cat file1 file2 fileN
cat bangalore mysore hubli (Displaying contents of multiple files)
touch
This command is used to create empty files.
Syntax
touch file1 file2 file3.. fileN touch a1 b1 c3 (Creating multiple empty files)