Linux Commands Flashcards
Practice Linux Terminal Commands
How to see all running processes in Linux System ?
htop
How to create alias ?
alias list=’ls’
How to list all aliases?
alias
How to search in Linux ?
locate filename
find / -name sample.txt # search for txt extension in given space
How to get hardware info ?
lscpulsmemlshw
How to read & execute file contents?
source filename
What is TCL interpretor ?
“Tool Command Language” (it is pronounced “tickle”)Its an command line interpreator .
How to get Welcome String after launching Linux Terminal ?
in .bashrc write your welcome string ,echo ‘Welcome Message’
What is the structure of Linux command ?
cmd -optons target
ls -lrt /tmp
How to get the calendar in terminal ?
cal
How to get the date ?
date
How to get the Disk Usage ?
df -h
How to get the file & directory size ?
du -sh /rooot/*
How to see processes that consume the most system resources?
top
How to get the short description of commands ?
whatis ls
How to get the location of commands & its manual
wehereis ls
How to get the full path of command ?
which pwd
How to list the directory contents in full detail in kb mb gb ?
ls -lah
How to go to the home directory ?
cdcd ~
How to Stop Particular Command in Terminal
ctrl + c
How to List Directory contents ?
ls
How to view file contents ?
cat filename
less filename
How to redirect ouptut ?
By using redirectional operator : cat /dev/random > /tmp/tempfile
How to clear terminal screen in linux ?
clear or ctrl + l
How to get processor details ?
show detail of each socket
cat /proc/cpuinfo
lscpu
How to get ram details in Linux ?
cat /proc/meminfo
lsmem
How to view links of files ?
ls -l
How to test a command from inside a manpage ?
type command followed by exclamation mark. !ls /proc/
Search for string inside a man page ?
search string followed by forward slash : /-l
How many sections are in man page ?
Total 8 Sections.
How to get Help for special Files using man ?
Specials Files And Devices are described under section 4 of man pages
man 4 filename
man 4 urandom`
What is long command for ls ?
ls -l
How to go to one level up to get relative path ?
/home/dir1/dir2#/home/dir1/dir3pwd/dir1/dir2/../dir3/
What means pwd ?
print working directory
How to find name server of Domain usinglinux terminal ?
host is a simple utility for performing DNS lookups. It is normally used to convert names to IP addresses and vice versa. When no arguments or options are given, host prints a short summary of its command line arguments and options.
host -vt ns ares.res.in
host -vt ns 14.139.225.232
How to get pid of running application ?
pid of firefox
How to list all PIDs ?
pidstat
How to list all open files in the whole system ?
lsof
How to list all files used by an user process ?
lsof -u username
Which Linux Command can we use to know, what files are opened by user ?
lsof -u username
What is the Default shell MAC OS ?
ZSH
Where to get random values in linux ?
/dev/random
/dev/urandom
Where to write data so that it can discarded ?
redirect the output to /dev/null
Which Directory represents process ?
/proc
Which Directory represents devices ?
/dev
What is a command to read file contents line by line in paced navigation ?
more filename
How to exit from more commnand ?
q , ctrl+c , ctrl +z
What is a command to display all block devices in a system ?
lsblk
What is the command to display detail information of mount points ?
mount
How to list the permission of parent directory
ls -ld /mnt
What is command to display process running in background ?
ps -elf
Which editor comes by default with every Linux distribution ?
vi editor
What is the full form of vi ?
visual editor
Which Editor supports spell checking ?
Nano editor
How to long list files ?
ls -l
How to list hidden files ?
ls -a
Which command read from file and display it on standard output ?
cat command
What is the full form of cat ?
Concatenate
How to see help of command ?
man,
info,
help
Which command is used for copy ?
cp
Which command is used to show current directory ?
pwd