Cheat Sheet for UNIX

UNIX

Introduction – Cheat sheet for UNIX

UNIX is a group of multi-user and multi-family operating systems that was originally derived from AT&T UNIX. Its research development was initially started at AT&T Bell Laboratory Research Center in the 1970s. It was developed by Dennis Ritchie, Ken Thompson, Brian Kernighan, Joe Ossanna and Douglas McIlroy at Bell Labs. It was initially released in the year 1971. It was licensed under the free and open source and some features under a proprietary license. The default user interfaces are Graphical User Interface (GUI) and Command Line Interface (CLI). It was written completely in Assembly Language and C programming language. It was presented with a Turing Award.

In this Cheat sheet for UNIX article, we will discuss what UNIX is and the different UNIX commands.

Cheat sheet for UNIX Commands and Content:

UNIX commands can often be differentiated or grouped into different categories of powerful commands such as File Commands, Process Management commands, Compression, Network related, File Permissions, Searching and SSH related. Below are the list of Cheat sheet for UNIX commands which perform different kinds of functionalities and operations in UNIX operating system are as follows:

UNIX commands Description
FILE I/O
lsTo list the directory.
pwdTo show the current directory.
mkdir folderTo create a new directory with the name folder
cp f1 f2To copy file f1 to file f2
mv f1 f2To move file f1 to file f2 if there exists a file named f2
rm f1To delete a file named f1
rm –r fileTo remove a file forcefully
rm –r dirTo delete a directory named dir
rm –rf dirTo forcefully remove a directory named dir
rm –f f1To forcefully remove a file named f1
touch fileTo create or update a file
more fileTo print the contents of a file as output
head fileTo print the contents of the first 10 lines of the file as output
tail fileTo print the contents of the last 10 lines of the file as output
PROCESS COMMANDS
psTo display all the currently active processes in the OS
kill pidTo kill the process with the mentioned process id as pid
fgTo bring the recently running job to foreground
bgTo list all the current background running processes or jobs
topTo display all the running processes.
NETWORK
ifconfigTo list down all the network related details such as all the assigned IP addresses IPv4 and IPv6, network interfaces etc.,
netstatTo list down all the ongoing connections in the local system and the details of ports being listened to and the services those are waiting for requests.
nslookupTo query the DNS lookup and find the related details.
hostnameTo know the details of the hostname and IP address mapped.
SEARCHING
findTo search the files in the directory specified.
grepTo search the selected lines in all the files that match the given pattern.
grep  <pattern> <files>To search for the pattern in given lines.
grep –rn <pattern> <dir>To search the pattern recursively for the pattern in a given directory including the line number.
grep –r <pattern> <dir>To search the pattern recursively for the pattern in given directory.
command | grep <pattern>To search for the pattern in the given output of the command.
Locate fileTo find all the instances of the file using an index-based system of the database that is built of updated command.
Find fileTo find all the occurrences of a file in the real system file directory.

Free Tips and Tricks of using Cheat sheet for Unix Commands:-

  1. The UNIX operating system has a kernel which is the core part of the system that coordinates the entire functionalities to perform different operations.
  2. It has a Shell which processes the utility requests by interpreting the UNIX commands provided in the terminal by the user.
  3. The entire data in cheat sheet UNIX is organized in a file system.
  4. The login command will be used to login to the UNIX system as a valid user before performing any operation whereas logout is the command to log out from the system as a user.
  5. Shell Scripting is the way of programming that is being carried on cheat sheet UNIX to execute the shell scripts (a series of commands) by the Kernel in UNIX Operating System.
  6. The file system security in UNIX is based on the access rights of the user such as R, W or X which are called R – Read permission, W – Write Permission, X – Execute Permission.
  7. There are different commands for access rights of a user in a UNIX system.

Cheat sheet for UNIX  commands are as follows:

Cheat sheet for UNIX co–mmandsDescription
chmodTo modify or change the file mode
chmod uTo change the file mode to user
chmod oTo change the file mode to other
chmod rTo change the file mode to read
chmod aTo change the file mode to all
chmod gTo change the file mode to group
chmod xTo change the file mode to execute by accessing the directory
chmod wTo change the file mode to write and delete
chmod –To change the file mode to remove the permission
chmod +To change the file mode to add the permission
  1. The compression of different files which are large can be carried out by using different files such as gzip, zcat, tar, gunzip etc., to compress and uncompress different tar files, to create archive files in the zip format etc.,

Cheat sheet for UNIX – conclusion

UNIX operating systems are mostly used in most of the server hosting systems to provide highly scalable and highly available systems. The main features and benefits of the UNIX systems are multi-tasking and multi-user capabilities to perform multitasking operations in order to save the time and resources for fulfilling long time taking processing operations. The other main benefit of using cheat sheet UNIX is its security and its speed of operations in the given time which produces effective and efficient results. UNIX has different variants of operating systems such as Linux, BSD etc. to provide different customized functionalities. UNIX has more flexibility and can be installed on different machines and also it is free to use and open source which reduces much overhead maintenance cost and highly beneficial with its operating system design and security and access features.

Leave a Reply

Your email address will not be published. Required fields are marked *