About UNIX
UNIX stands for UNiplexed Information Computing System (UNICS), also known as UNIX. A UNIX operating system is a multitasking operating system that allows you to initiate more than one task from the same terminal.
LINUX is an advanced version of UNIX. It has several features similar to UNIX, still has some key differences. Linux is open-source software and can be used freely without any licensing fees.
Why UNIX is popular than Windows?
UNIX-based systems are inherently more secure than the Windows operating system.
Shell in UNIX
A shell is an environment in which we can run our Unix commands, programs, and shell scripts.
Examples:
- Bourne shell (sh)
- Korn shell (ksh)
- Bourne Again shell (bash)
- C shell (csh)
Tools used for UNIX in real-time
To work with UNIX we have two free tools available: PuTTY and WinSCP.
- PuTTY — a UNIX CLI (Command Line Interface) tool used to run UNIX commands.
- WinSCP — a UNIX GUI (Graphical User Interface) tool used to access files on the UNIX operating system.
Why should I learn UNIX as an Informatica Developer?
- We have a Command Task in Informatica — UNIX / Windows commands are used inside the Command Task.
- In real-time, the Informatica Server is installed on UNIX. The
INFA_SHAREDfolder lives on the UNIX server. To accessINFA_SHAREDand source / target / other files you need UNIX commands. - We can schedule Informatica jobs in UNIX using crontab.
UNIX Commands Reference
1. pwd
Print the Present Working Directory in UNIX.
2. mkdir
Create a directory in UNIX.
Create more than one nested directory at once:
3. rmdir
Remove a directory in UNIX.
4. cd
Change directory in UNIX.
5. cal
Display the calendar.
6. date
Display the system date and time.
Syntax: date [+format]
Example — display the date in dd/mm/yy format:
7. Creating a file in UNIX
a) Using cat command
b) Using touch command
8. ls — listing directories and files
All data in UNIX is organised into files. All files are organised into directories. These directories are organised into a tree-like structure called the filesystem.
Use the ls command to list out all the files or directories available in a directory.
ls -l— list with long format (show permissions)ls -a— list all files including hidden files starting with.ls -R— recursive directory tree listls -t— sort by time & datels -r— list in reverse orderls -ls— list with long format with file sizels -lrt— long format, reverse, sorted by time
Wildcards: * matches 0 or more characters; ? matches a single character.
9. whoami
Displays the user id of the currently logged-in user.
10. who
Displays the list of users currently logged in.
11. wc — counting words in a file
You can pass multiple files at once:
wc -l state.txt— number of lines in a filewc -l state.txt capital.txt— works across multiple fileswc -w state.txt— number of words in a filewc -c state.txt— count of bytes in a filewc -m state.txt— count of characters in a filewc -L demo_file— length of the longest line in the file
13. cp — copying files
Syntax: cp source_file destination_file
14. mv — renaming files
Syntax: mv old_file new_file
15. rm — deleting files
16. chmod — change file/directory permissions
4stands for read2stands for write1stands for execute0stands for no permission
Set read + write for other users:
Remove the write permission for other users:
Set execute permission for all users:
17. Sending email
Syntax: mail [-s subject] [-c cc-addr] [-b bcc-addr] to-addr
Send a test message:
|).19. ps
Display currently running processes.
20. kill
Kill the current process.
21. man — manual / help
Interface for working with the online reference manuals.
Syntax: man [-s section] item
22. find — search for files and directories
Syntax: find [starting-point] [expression]
23. du — disk usage
Estimate disk usage in blocks.
Syntax: du [options] [file]
24. df — disk free
Show number of free blocks for mounted file systems.
Syntax: df [options] [file]
grep · sort · uniq · cat · more · cut · paste · head · tail · wc · tr — these are the filter commands you reach for most often when shaping streams of text.25. grep — search for a pattern
Searches a file or files for lines that have a certain pattern. Comes from g/re/p — globally search for a regular expression and print all lines containing it.
^— exclude ([^aeiou]) OR anchor to the start of a line$— anchor to the end of a line
26. sort — order lines
Arrange lines of text alphabetically or numerically.
Initial contents of file1.txt:
27. uniq — report / filter repeated lines
sort file.txt | uniq -u` — remove duplicate lines from a file in UNIX.
`sort file.txt | uniq -u | cat file.txt`` — remove and display the contents of the file.28. head
head by default prints the first 10 lines of each file to standard output.
29. tail
tail by default prints the last 10 lines of each file.
Display the *n*th line of a file:
30. diff — compare two or more files
31. tr — translate / delete characters
Syntax: tr [OPTION] SET1 [SET2]
32. cut — extract sections from each line
Syntax: cut OPTION… [FILE]…
33. zip / unzip
34. echo
Display a line of text / string that is passed as an argument.
35. rev — reverse characters per line
Reverse a string:
36. sed — stream editor
A lot of functions on a file: searching, find and replace, insertion or deletion.
Syntax: sed OPTIONS… [SCRIPT] [INPUTFILE…]
37. awk — scripting for reports
awk is a scripting language used for manipulating data and generating reports. It requires no compiling and allows variables, numeric and string functions, and logical operators.
awk operations:
- Scans a file line by line
- Splits each input line into fields
- Compares input line / fields to a pattern
- Performs action(s) on matched lines
Useful for:
- Transform data files
- Produce formatted reports
Programming constructs:
- Format output lines
- Arithmetic and string operations
- Conditionals and loops
38. history
Give the entire history of the commands you have used.

