All Developing, Hacking & Cracking Codes with Bots

Thursday, September 29

Linux Commands for new User : Must know

sudo dpkg -i package_name.deb
To install a package which is in debian package

who
show the current users have been logged on --> who
alias
make an alias name for any command like 'ls -l' --> alias list='ls -l'
unalias
remove alias definition --> unalias list
whereis
gives address of binary, source and manual pages --> whereis ls
whatis
display manual page description or tells short description about any command --> whatis man
man
used for manual help or brief description of any command with options --> man ls
whoami
tells effective userid means your user id --> whoami
ls
list directory contents
dir
list directory contents
cd
changing directory --> cd foldername
mkdir
make directory --> mkdir foldername
apt-get install
search and install package direct form internet (for install netbeans on your pc) --> apt-get install netbeans-7.0.1-ml-javaee-linux.sh
aptitude
high level interface for package manager in terminal for checking all installed packages and available packages for new installation
aspell
spelling checker in file (here aspell and check are both keywords followed by filename)--> aspell check abc.txt
Ctrl + Z
for killing current process
awk
pattern scanning and processing language --> awk '/good/ {print $1 " salary is Rs " $2*$3}' inventory
grep
prints line matching a pattern --> grep "searchedstring" filename
read
read from keyboard for generally shell scripting files --> read x
cal
displays calender and date of Easter
cat
creating,viewing,concatenate of text file
chmod
changes the file permission for (read, write and execution) --> chmod 755 filename
clear
clear screen
cmp
compare two files
cp
copy files from one location to another --> cd file1 /opt/file1
date
writes date and time
df
report free disk space
du
report about disk usage
diff
compare files line by line --> diff fileone filetwo
history
for viewing all different command used in terminal recently
echo
for showing any message it can be anything string, integer or float value --> echo "prem bharti"
ifconfig
getting all information about your network connection like ipaddress,subnetmast, gateway etc
bg
runjobs in background
fg
runjobs in foreground
id
returns user identity
head
gives output given first part of file (for showing first 2 lines of file abd) --> head -2 abd
ln
create a linkfile for original file --> ln abc.sh $HOME/Desktop/abd.sh
more
display file on page by page basis
mv
moving a file to another location --> mv filename /otherdirectory/filename
ps
gives snapshot of current running processes
pwd
gives present working directory
rmdir
removes given directory --> rmdir nameofdirectory
sleep
suspends given process for given time (we want to sleep mplayer music software for 10 sec --> sleep 10 ; mplayer foo.mp3
tail
output last part of files
wc
gives output in form of no. of lines, words, characters in a file --> wc filename
uniq
used for file and output doesn't contain repeated line --> uniq filename
touch
change a file's access and modification timestamps. Also create a new empty file. --> touch filename

No comments: