![]() |
|
Best Linux Guide And Command Explanation - Printable Version +- Sinisterly (https://sinister.ly) +-- Forum: Computers (https://sinister.ly/Forum-Computers) +--- Forum: Operating Systems (https://sinister.ly/Forum-Operating-Systems) +--- Thread: Best Linux Guide And Command Explanation (/Thread-Best-Linux-Guide-And-Command-Explanation) Pages:
1
2
|
Best Linux Guide And Command Explanation - dR.0xYw0Rm - 11-20-2013 S u p H C
Today I am going to explain you what is Linux and alot of useful Linux terminal commands.
If you still haven't decide which Linux distro to choose I would highly recommend you checking my guide: * How To Choose The Right Linux Distribution For You * ![]() Linux is a Unix-like and POSIX-compliant computer operating system assembled under the model of free and open source software development and distribution. It is a freeware and generally speaking its free from Virus and other malware infections. The main form of distribution are Linux distributions. It's a bit harder to learn at first , a lot of command line stuff but when you get to grips with it it can be very rewarding. The big thing about linux is that it is open source, which means there are virtually no license limitations so people can do what they want with it, this can be very useful for people who have very specific requirements and dont want to get involved in messy licensing as you would with windows for example. ![]() Linux is multi platform. This means that by choosing Linux, you choose a portable operating system on which you can run or develop portable applications. Linux runs on Sparc(Sun), Alpha(Compaq), Mips, ARM, x86(Intel), PowerPC, 680x0(Motorola), RS6000 (IBM), and so on... So,when choosing Linux for your operating system,you open choices to you. You don't reduce your choices to no otherc hoice than Intel running IBM compatible. Linux is not under the control of NSA. The NSA (NationalSecurityAgency,USA) and Microsoft recognized that two sets of secret keys where shipped with Windows in order to allow either Microsoft and NSA to enter any Windows running computer in the world Linux is open source. Anybody can check if there is such a backdoor in it. NSA is working on a certificated secure version of the Linux kernel for USA use,because they know Windows is not secure. ![]() Note: The commands below are top 5 in my opinion not officially. "sudo" Code: sudoSudo best thought of as ‘Superuser Do’, allows you to run commands with root/administrator permissions. For example: You can't do: Code: apt-get updateIf you are not logged in as "root" So all we have to do is to add "sudo" at the beginning of the command. Code: sudo apt-get update"apt-get install" Code: apt-get installAllows you to install applications available in the Ubuntu Software Center and added PPAs can be installed from the command line using ‘apt-get install‘. I.E: (Installing tor on your machine) Code: apt-get install tor"top" Code: topTop command which is one of the most frequently used commands in our daily system administrative jobs. Top command displays processor activity of your Linux box and also displays tasks managed by kernel in real-time. It’ll show processor and memory are being used and other information like running processes. This may help you to take correct action. top command found in UNIX-like operating systems. You can perform different actions with that , even killing processes. "cd" Code: cd‘cd folder/name/’ will navigate you into that folder To go back on folder type Code: cd -Tip: Remember you can always use the ‘Tab’ button to auto-complete commands and locations in the Terminal. "ls" Code: ls![]() Show the current date and time Code: dateShow this month's calendar Code: calShow current uptime Code: uptimeDisplay who is online Code: wWho you are logged in as Code: whoamiDisplay information about user Code: finger userShow kernel information Code: uname -aCpu information Code: cat /proc/cpuinfoMemory information Code: cat /proc/meminfoShow disk usage Code: dfShow directory space usage Code: duShow memory and swap usage Code: free![]() Clear the terminal Code: CTRL LShow content of file Code: cat <fileName>Logout Code: CTRL DGo up/down the terminal Code: SHIFT Page Up/DownFrom the top Code: headCursor to start of line Code: CTRL ACursor the end of line Code: CTRL EDelete left of the cursor Code: CTRL UFrom the bottom Code: tailDelete right of the cursor Code: CTRL KDelete word on the left Code: CTRL WPaste (after CTRL U,K or W) Code: CTRL YCreate new folder Code: mkdirAuto completion of file or command Code: TABReverse search history Code: CTRL RRepeat last command Code: !!![]() List all files and folders <folderName> list files in folder Code: ls -aDetailed list, Human readable Code: ls -lhList jpeg files only Code: ls -l *.jpgResult for file only Code: ls -lh <fileName>Change directory if folder name has spaces use “ “ Code: cd <folderName>Go to root Code: cd /Go up one folder, tip: ../../../ Code: cd ..Disk usage of folders, human readable Code: du -hOnly show disc usage of folders Code: du -shPrint working directory Code: pwdShows manual (RTFM) Code: man <command>![]() From the top Code: headSshow content of file Code: cat <fileName>From the bottom -n <oflines> <fileName> Code: tailCreate new folder Code: mkdirCopy image to folder Code: cp image.jpg <folderName>/Copy and rename a folder Code: cp -R stuff otherStuffCopy all of *<file type> to folder Code: cp *.txt stuff/Move file to a folder Code: mv file.txt Documents/Move folder in folder Code: mv <folderName> <folderName2>Rename file Code: mv filename.txt filename2.txtMove folder up in hierarchy Code: mv <folderName>/ ..Delete file (s) Code: rm <fileName> ..Ask for confirmation each file Code: rm -i <fileName> ..Force deletion of a file Code: rm -f <fileName>Delete folder Code: rm -r <foldername>/Physical link Code: ln file1 file2Symbolic link Code: ln -s file1 file2![]() List manual pages for subject Code: apropos subjectDisplay man pages containing keyword Code: man -k keywordShow the manual for command Code: man commandMake a pdf of a manual page Code: man -t man | ps2pdf - > man.pdfShow full path name of command Code: which commandSee how long a command takes Code: time commandShow possible locations of app Code: whereis appShow which app will be run by default; it shows the full path Code: which app![]() Search for pattern in files Code: grep pattern filesSearch recursively for pattern in dir Code: grep -r pattern dirSearch for pattern in the output of command Code: command | grep patternFind all instances of file Code: locate fileStarting with the root directory, look for the file called filename Code: find / -name filenameStarting with the root directory, look for the file containing the string filename Code: find / -name ”*filename*” –Find a file called filename using the locate command; this assumes you have already used the command updatedb (see next) Code: locate filenameCreate or update the database of files on all file systems attached to the Linux root directory Code: updatedbShow the subdirectory containing the executable file called filename Code: which filenameStarting with the directory called dir, look for and list all files containing TextStringToFind Code: grep TextStringToFind /dir –![]() Change the permissions of file to octal, which can be found separately for user, group, and world by adding: 4 – read ®, 2 – write (w), 1 – execute (x) Examples: chmod 777 – read, write, execute for all chmod 755 – rwx for owner, rx for group and world For more options, see man chmod. Code: chmod octal file![]() Connect to host as user Code: ssh user@hostConnect to host on port port as user Code: ssh -p port user@hostAdd your key to host for user to enable a keyed or passwordless login Code: ssh-copy-id user@host![]() List IP addresses for all devices on the local machine Code: ifconfigPing host and output results Code: ping hostGet whois information for domain Code: whois domainGet DNS information for domain Code: dig domainReverse lookup host Code: dig -x hostDownload file Code: wget fileContinue a stopped download Code: wget -c file[/code+
[IMG]http://i.imgur.com/Ll6RIhq.png[/IMG]
Create a new user call accountname
[code]adduser accountnameGive accountname a new password Code: passwd accountnameLog in as superuser from current login Code: suStop being superuser and revert to normal user Code: exit![]() Display your currently active processes Code: psDisplay all running processes Code: topKill process id pid Code: kill pidKill all processes named proc (use with extreme caution) Code: killall procLists stopped or background jobs; resume a stopped job in the background Code: bgBrings the most recent job to foreground Code: fgBrings job n to the foreground Code: fg n![]() Installation from source Code: ./configure
make
make installinstall a DEB package (Debian / Ubuntu / Linux Mint) Code: dpkg -i pkg.debinstall a RPM package (Red Hat / Fedora) Code: rpm -Uvh pkg.rpm(YUM) Yellowdog Updater Modified Install the specified packages Code: yum install {package-name-1} {package-name-2}
Install package called httpd:
yum install httpdRemove / Uninstall the specified packages Remove package called httpd, enter: Code: yum remove {package-name-1} {package-name-2}
yum remove httpdDisplay the list of available packages Code: yum list allDisplay list of group software Code: yum grouplistDisplay list of updated software Code: yum list updatesList all installed packages Code: rpm -qa
yum list installedFind out if httpd package installed or not: Code: rpm -qa | grep httpd*
yum list installed httpdCheck for and update specified package Code: yum update {package-name}To check for and update httpd package Code: yum update httpdFinding packages containing missing dependencies when installing software from source Code: yum whatprovides */<dependencyName>Pacman Lists all installed packages Code: pacman -QInstall packages (from file) Code: pacman -UUpdates the list of packages and installs a given package (from repository) Code: pacman -SyUpdate packages installed on your system with the latest versions in the archives Code: pacman -SuUpdates the list of packages and upgrade the packages installed on the system Code: pacman -SyuRemove a package Code: pacman -RcRemove a package, delete the configuration files and eliminates the dependencies Code: pacman -RsnDelete orphaned packages Code: pacman -Rs $(pacman -Qqtd)Try searching within the package database Code: pacman -SsShow the detailed information on a given package Code: pacman -SiClear the system cache of video packets Code: pacman -Sc![]() Shutdown the system now and do not reboot Code: shutdown -h nowStop all processes - same as above Code: haltShutdown the system in 5 minutes and reboot Code: shutdown -r 5Shutdown the system now and reboot Code: shutdown -r nowStop all processes and then reboot - same as above Code: rebootStart the X system Code: startxI hope I learned something new to you. :> Share it but don't forget to give credits. - dR.0xYw0Rm aka Gaara RE: ★★ BEST LINUX GUIDE AND COMMANDS EXPLANATION ★★ - tuxthepenguin - 11-21-2013 very good one for total newbies. i really like that you gave explanation on theadditional options on the subject. RE: ★★ BEST LINUX GUIDE AND COMMANDS EXPLANATION ★★ - tuxthepenguin - 11-21-2013 very good one for total newbies. i really like that you gave explanation on theadditional options on the subject. RE: ★★ BEST LINUX GUIDE AND COMMANDS EXPLANATION ★★ - Psycho_Coder - 11-21-2013 Excellent resources. You did a very good job and the thread is very well designed. RE: ★★ BEST LINUX GUIDE AND COMMANDS EXPLANATION ★★ - Psycho_Coder - 11-21-2013 Excellent resources. You did a very good job and the thread is very well designed. RE: ★★ BEST LINUX GUIDE AND COMMANDS EXPLANATION ★★ - chmod - 11-21-2013 This is good, however I have a couple of things to bring up, at the start of the guide you use apt-get for installing/updating software, as you know this is for Debian based systems and won't work under Redhat (yum) or arch (pacman) based systems. One feature of the yum package manager which you missed is Code: yum whatprovides */<dependencyName>And again with startx, this presumes you are using xorg package to manage the windows, this is dependent upon the window manager the user is using, for example I use xfce which uses gdm3 instead. RE: ★★ BEST LINUX GUIDE AND COMMANDS EXPLANATION ★★ - chmod - 11-21-2013 This is good, however I have a couple of things to bring up, at the start of the guide you use apt-get for installing/updating software, as you know this is for Debian based systems and won't work under Redhat (yum) or arch (pacman) based systems. One feature of the yum package manager which you missed is Code: yum whatprovides */<dependencyName>And again with startx, this presumes you are using xorg package to manage the windows, this is dependent upon the window manager the user is using, for example I use xfce which uses gdm3 instead. RE: ★★ BEST LINUX GUIDE AND COMMANDS EXPLANATION ★★ - Rohit123 - 11-21-2013 excellent but can I have any ebook like these tutorials...... how simple was explained. ... RE: ★★ BEST LINUX GUIDE AND COMMANDS EXPLANATION ★★ - Rohit123 - 11-21-2013 excellent but can I have any ebook like these tutorials...... how simple was explained. ... RE: ★★ BEST LINUX GUIDE AND COMMANDS EXPLANATION ★★ - Psycho_Coder - 11-21-2013 Will you please re-write the title using Title case. All caps looks awful. |