File Manipulation Unix Command
Command |
Description |
Example |
---|---|---|
touch |
Creates an empty file or updates the access and modification times. |
touch new_file.txt |
cp |
Copies files or directories. |
cp file1.txt file2.txt |
mv |
Moves files or directories. |
mv file1.txt Documents |
rm |
Remove files or directories. |
rm old_file.txt |
chmod |
Changes the permissions of a file or directory. |
chmod 644 file.txt |
chown |
Changes the owner and group of a file or directory. |
chown user:group file.txt |
ln |
Creates links between files. |
ln -s target_file symlink |
cat | Concatenates files and displays their contents. | cat file1.txt file2.txt |
head | Displays the first few lines of a file. | head file.txt |
tail | Displays the last few lines of a file. | tail file.txt |
more | Displays the contents of a file page by page. | more file.txt |
less | Displays the contents of a file with advanced navigation features. | less file.txt |
diff | Compares files line by line. | diff file1.txt file2.txt |
patch | Applies a diff file to update a target file. | patch file.txt < changes.diff |
Essential Unix Commands
Unix commands are a set of commands that are used to interact with the Unix operating system. Unix is a powerful, multi-user, multi-tasking operating system that was developed in the 1960s by Bell Labs. Unix commands are entered at the command prompt in a terminal window, and they allow users to perform a wide variety of tasks, such as managing files and directories, running processes, managing user accounts, and configuring network settings. Unix is now one of the most commonly used Operating systems used for various purposes such as Personal use, Servers, Smartphones, and many more. It was developed in the 1970’s at AT& T Labs by two famous personalities Dennis M. Ritchie and Ken Thompson.
- You’ll be surprised to know that the most popular programming language C came into existence to write the Unix Operating System.
- Linux is Unix-Like operating system.
- The most important part of the Linux is Linux Kernel which was first released in the early 90s by Linus Torvalds. There are several Linux distros available (most are open-source and free to download and use) such as Ubuntu, Debian, Fedora, Kali, Mint, Gentoo, Arch and much more.
- Now coming to the Basic and most usable commands of Linux/Unix part. (Please note that all the linux/unix commands are run in the terminal of a linux system.Terminal is like command prompt as that of in Windows OS)
- Linux/Unix commands are case-sensitive i.e Hello is different from hello.