A Quick Introduction To Linux
A Quick Introduction To Linux
Tusharadri Sarkar
Tusharadri Sarkar
Tusharadri Sarkar
Tusharadri Sarkar
Main Directories
/ bin boot etc dev home lib The parent (root) directory Compiled executable files (ls, grep) Linux Kernel images and configs System configuration files Device files for all system H/Ws Stores home directories of users System library files
June 28, 2010 Tusharadri Sarkar 5
Main Directories
Stores files and executables that all usr users can access var Stores files whose size might vary tmp Stores temporary files Stores executables for system sbin administrator, user can also access Provides Kernel windows to view proc system status (memory, IO etc.)
June 28, 2010 Tusharadri Sarkar 6
What does it do? The .bashrc file: Your own set of aliases
June 28, 2010 Tusharadri Sarkar 9
Directory Navigation
pwd Present Working Directory cd Login (home) dir. of the user cd Users last (previous) dir. cd ~/<path> Here, ~ stands for home cd /<path> Using absolute path cd .. One dir. level up '.' (dot) and '..' (dot dot) indicate current and parent directories, just like Windows
June 28, 2010 Tusharadri Sarkar 10
Tusharadri Sarkar
14
3. > sed '/ *#/d; /^ *$/d' trickier !! 4. > sed ':a; /\\$/N; s/\\\n//; ta' too cryptic !!!
Case conversion
> tr dc '[:print:]' < /dev/urandom
Basic Networking
ifconfig: An equivalent of 'ipconfig' on DOS, but it does much more
> ifconfig > ifconfig < interface>
iwconfig: 'w' for wireless network hostname: When you want to know about the host/ the system you are on
> hostname > hostname i
June 28, 2010 Tusharadri Sarkar 25
Basic Networking
netstat: Working with kernel routing table > netstat r > netstat i > netstat l > netstat tup route: Modifying the kernel routing table > route add [route addr] [interface] > route delete [route addr] [interface]
June 28, 2010 Tusharadri Sarkar 26
Miscellaneous
Get familiar with the time keepers: cal: Calendar, no one can live without it... > cal (current months calendar) > cal <mm> <yyyy> (for specific month) date: Of course you want to know this... > date (Date with IST) > date %d/%m%y %H:%M:%S (A more familiar date format)
June 28, 2010 Tusharadri Sarkar 32
Miscellaneous
Where are your commands resting? > which <command> > whereis <command> Read a file without opening it: > cat <filename> Finally, the grand Manual of Linux: > man <item> The <item> list is really large!! Try it...
June 28, 2010 Tusharadri Sarkar 33
Thank You !!
34