{"id":211,"date":"2009-05-27T23:40:15","date_gmt":"2009-05-27T23:40:15","guid":{"rendered":"http:\/\/g33kinfo.com\/info\/index.php\/?p=211"},"modified":"2009-05-27T23:40:15","modified_gmt":"2009-05-27T23:40:15","slug":"linux-commands","status":"publish","type":"post","link":"https:\/\/g33kinfo.com\/info\/linux-commands\/","title":{"rendered":"Linux Commands"},"content":{"rendered":"<p>Privileges<\/p>\n<p>sudo command &#8211; run command as root<br \/>\nsudo su &#8211; open a root shell<br \/>\nsudo su user &#8211; open a shell as user<br \/>\nsudo -k &#8211; forget sudo passwords<br \/>\ngksudo command &#8211; visual sudo dialog (GNOME)<br \/>\nkdesudo command &#8211; visual sudo dialog (KDE)<br \/>\nsudo visudo &#8211; edit \/etc\/sudoers<br \/>\ngksudo nautilus &#8211; root file manager (GNOME)<br \/>\nkdesudo konqueror &#8211; root file manager (KDE)<br \/>\npasswd &#8211; change your password<\/p>\n<p>Display<\/p>\n<p>sudo \/etc\/init.d\/gdm restart &#8211; restart X (GNOME)<br \/>\nsudo \/etc\/init.d\/kdm restart &#8211; restart X (KDE)<br \/>\n(file) \/etc\/X11\/xorg.conf &#8211; display configuration<br \/>\nsudo dpkg-reconfigure -phigh xserver-xorg &#8211; reset X configuration<br \/>\nCtrl+Alt+Bksp &#8211; restart X display if frozen<br \/>\nCtrl+Alt+FN &#8211; switch to tty N<br \/>\nCtrl+Alt+F7 &#8211; switch back to X display<\/p>\n<p>This command will usually tell you the vendor and model of your graphic card<br \/>\nlist<br \/>\nlspci<br \/>\nlspci -v<br \/>\nlspci -v | less<\/p>\n<p>System Services<\/p>\n<p>start service &#8211; start job service (Upstart)<br \/>\nstop service &#8211; stop job service (Upstart)<br \/>\nstatus service &#8211; check if service is running (Upstart)<br \/>\n\/etc\/init.d\/service start &#8211; start service (SysV)<br \/>\n\/etc\/init.d\/service stop &#8211; stop service (SysV)<br \/>\n\/etc\/init.d\/service status &#8211; check service (SysV)<br \/>\n\/etc\/init.d\/service restart &#8211; restart service (SysV)<br \/>\nrunlevel &#8211; get current runlevel<\/p>\n<p>Package Management<\/p>\n<p>apt-get update &#8211; refresh available updates<br \/>\napt-get upgrade &#8211; upgrade all packages<br \/>\napt-get dist-upgrade &#8211; upgrade Ubuntu version<br \/>\napt-get install pkg &#8211; install pkg<br \/>\napt-get remove pkg &#8211; uninstall pkg<br \/>\napt-get autoremove &#8211; remove obsolete packages<br \/>\napt-get -f install &#8211; try to fix broken packages<br \/>\ndpkg \u2013configure -a &#8211; try to fix broken packages<br \/>\ndpkg -i pkg.deb &#8211; install file pkg.deb<br \/>\n(file) \/etc\/apt\/sources.list &#8211; APT repository list<\/p>\n<p>Network<\/p>\n<p>ifconfig &#8211; show network information<br \/>\niwconfig &#8211; show wireless information<br \/>\nsudo iwlist scan &#8211; scan for wireless networks<br \/>\nsudo \/etc\/init.d\/networking restart &#8211; reset network<br \/>\n(file) \/etc\/network\/interfaces &#8211; manual configuration<br \/>\nifup interface &#8211; bring interface online<br \/>\nifdown interface &#8211; disable interface<\/p>\n<p>Special Packages<\/p>\n<p>ubuntu-desktop &#8211; standard Ubuntu environment<br \/>\nkubuntu-desktop &#8211; KDE desktop<br \/>\nxubuntu-desktop &#8211; XFCE desktop<br \/>\nubuntu-minimal &#8211; core Ubuntu utilities<br \/>\nubuntu-standard &#8211; standard Ubuntu utilities<br \/>\nubuntu-restricted-extras &#8211; non-free, but useful<br \/>\nkubuntu-restricted-extras &#8211; KDE of the above<br \/>\nxubuntu-restricted-extras &#8211; XFCE of the above<br \/>\nbuild-essential &#8211; packages used to compile programs<br \/>\nlinux-image-generic &#8211; latest generic kernel image<br \/>\nlinux-headers-generic &#8211; latest build headers<\/p>\n<p>Firewall<\/p>\n<p>ufw enable &#8211; turn on the firewall<br \/>\nufw disable &#8211; turn off the firewall<br \/>\nufw default allow &#8211; allow all connections by default<br \/>\nufw default deny &#8211; drop all connections by default<br \/>\nufw status &#8211; current status and rules<br \/>\nufw allow port &#8211; allow traffic on port<br \/>\nufw deny port &#8211; block port<br \/>\nufw deny from ip &#8211; block ip adress<\/p>\n<p>Application Names<\/p>\n<p>nautilus &#8211; file manager (GNOME)<br \/>\ndolphin &#8211; file manager (KDE)<br \/>\nkonqueror &#8211; web browser\/filemanager (KDE)<br \/>\nkate &#8211; text editor (KDE)<br \/>\ngedit &#8211; text editor (GNOME)<\/p>\n<p>System<\/p>\n<p>Recovery &#8211; Type the phrase \u201cREISUB\u201d while<br \/>\nholding down Alt and SysRq (PrintScrn) with<br \/>\nabout 1 second between each letter. Your system<br \/>\nwill reboot.<br \/>\nlsb_release -a &#8211; get Ubuntu version<br \/>\nuname -r &#8211; get kernel version<br \/>\nuname -a &#8211; get all kernel information<\/p>\n<p>Moving around in the file system<\/p>\n<p>pwd &#8220;Print working directory&#8221; &#8211; show what dir you&#8217;re in.<br \/>\nls -List the contents of a dir.<br \/>\nls -l -List the contents of a dir and show additional info of the files.<br \/>\nls -a -List all files, including hidden files.<br \/>\ncd -Change directory.<br \/>\ncd .. -Go to the parent directory.<\/p>\n<p>Manipulating files and directories<\/p>\n<p>cp -Copy a file.<br \/>\ncp -i -Copy a file and ask before overwriting.<br \/>\ncp -r -Copy a directory with its contents.<br \/>\nmv -Move or rename a file.<br \/>\nmv -i -Move or rename a file and ask before overwriting.<br \/>\nrm -Remove a file.<br \/>\nrm -r -Remove a directory with its contents.<br \/>\nrm -i -Ask before removing a file. Good to use with the -r option.<br \/>\nmkdir -Make a directory.<br \/>\nrmdir -Remove an empty directory.<\/p>\n<p>zipping\/taring<\/p>\n<p>tar -cvzf mytar.tar.gz sourcefilesordir &#8211; creates a new tar file, verbose options on, runs it through gnuzip,f is the filename<br \/>\ntar -xvf mytar.tar.gz destination &#8211; extracts a tar file (this example is compressed with gzip), verbosely, f is the filename<br \/>\ngzip fileordir &#8211; compresses a file with gzip.<br \/>\ngunzip file.gz &#8211; decompresses a file with gzip.<br \/>\nNB gzip only compresses files, it doesn\u2019t collect them into a single file like a tarball does.<\/p>\n<p>More Commands<\/p>\n<p>Arrow Up: scrolls and edits the command history, press enter to activate.<br \/>\nShift+pgup: scrolls terminal output up<br \/>\nShift+pgdown: scrolls terminal output down<br \/>\nCTRL-ALT+DEL reboots the system<br \/>\nShutdown -h now turns the system off<br \/>\nCTRL C kills the current process<br \/>\nCTRL S Stops the tranfer to the terminal<br \/>\nCTRL Q Resumes the transfer to the terminal<br \/>\nCTRL Z Puts the current process in the background.<\/p>\n<p>hostname &#8211; Shows the host name of the system you are on<br \/>\nwhoami Displays your login name<br \/>\ndate &#8211; Displays what your machine thinks the date is<br \/>\nwho &#8211; Shows who is logged into the machine<br \/>\nrwho-a -Shows all users logged into the server network<br \/>\nfinger <user name> Shows info on chosen user<br \/>\nlast &#8211; Show the last users logged into the machine<br \/>\nuptime &#8211; Shows the systems uptime<br \/>\nPS &#8211; Shows the current user processes<br \/>\nPS -A &#8211; Shows all process on the system<br \/>\nuname -A -Displays all info on your host.<br \/>\nfree -Shows the free memory in KB<br \/>\ndf -h -Shows the disk space details<br \/>\ncat\/proc\/cpuinfo -Shows the CPU information<br \/>\ncat\/proc\/filesystems -Shows the file system information in use<br \/>\ncat\/etc\/printcap -Shows if any printers are hooked up<br \/>\nlsmod -Shows the kernel modules loaded<br \/>\n<\/user><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Privileges sudo command &#8211; run command as root sudo su &#8211; open a root shell sudo su user &#8211; open a shell as user sudo -k &#8211; forget sudo passwords gksudo command &#8211; visual sudo dialog (GNOME) kdesudo command &#8211; visual sudo dialog (KDE) sudo visudo &#8211; edit \/etc\/sudoers gksudo nautilus &#8211; root file manager&#8230; <\/p>\n<div class=\"read-more navbutton\"><a href=\"https:\/\/g33kinfo.com\/info\/linux-commands\/\">Read More<i class=\"fa fa-angle-double-right\"><\/i><\/a><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-211","post","type-post","status-publish","format-standard","hentry","category-info"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.0 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Linux Commands - Linux Shtuff<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/g33kinfo.com\/info\/linux-commands\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Linux Commands - Linux Shtuff\" \/>\n<meta property=\"og:description\" content=\"Privileges sudo command &#8211; run command as root sudo su &#8211; open a root shell sudo su user &#8211; open a shell as user sudo -k &#8211; forget sudo passwords gksudo command &#8211; visual sudo dialog (GNOME) kdesudo command &#8211; visual sudo dialog (KDE) sudo visudo &#8211; edit \/etc\/sudoers gksudo nautilus &#8211; root file manager... Read More\" \/>\n<meta property=\"og:url\" content=\"https:\/\/g33kinfo.com\/info\/linux-commands\/\" \/>\n<meta property=\"og:site_name\" content=\"Linux Shtuff\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/fb.me\/g33kinf0\" \/>\n<meta property=\"article:author\" content=\"https:\/\/fb.me\/g33kinf0\" \/>\n<meta property=\"article:published_time\" content=\"2009-05-27T23:40:15+00:00\" \/>\n<meta name=\"author\" content=\"g33kadmin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/drsinger1111\" \/>\n<meta name=\"twitter:site\" content=\"@drsinger1111\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/linux-commands\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/linux-commands\\\/\"},\"author\":{\"name\":\"g33kadmin\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#\\\/schema\\\/person\\\/c022e4c40b13ea1b678e6f020756f547\"},\"headline\":\"Linux Commands\",\"datePublished\":\"2009-05-27T23:40:15+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/linux-commands\\\/\"},\"wordCount\":957,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#\\\/schema\\\/person\\\/c022e4c40b13ea1b678e6f020756f547\"},\"articleSection\":[\"General Info\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/g33kinfo.com\\\/info\\\/linux-commands\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/linux-commands\\\/\",\"url\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/linux-commands\\\/\",\"name\":\"Linux Commands - Linux Shtuff\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#website\"},\"datePublished\":\"2009-05-27T23:40:15+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/linux-commands\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/g33kinfo.com\\\/info\\\/linux-commands\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/linux-commands\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Linux Commands\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#website\",\"url\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/\",\"name\":\"Linux Shtuff\",\"description\":\"Because I have CRS Syndrome...\",\"publisher\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#\\\/schema\\\/person\\\/c022e4c40b13ea1b678e6f020756f547\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#\\\/schema\\\/person\\\/c022e4c40b13ea1b678e6f020756f547\",\"name\":\"g33kadmin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/minion-researchA.gif\",\"url\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/minion-researchA.gif\",\"contentUrl\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/minion-researchA.gif\",\"width\":512,\"height\":512,\"caption\":\"g33kadmin\"},\"logo\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/minion-researchA.gif\"},\"description\":\"I am a g33k, Linux blogger, developer, student and Tech Writer for Liquidweb.com\\\/kb. My passion for all things tech drives my hunt for all the coolz. I often need a vacation after I get back from vacation....\",\"sameAs\":[\"https:\\\/\\\/thelinuxreport.com\",\"https:\\\/\\\/fb.me\\\/g33kinf0\",\"https:\\\/\\\/x.com\\\/https:\\\/\\\/twitter.com\\\/drsinger1111\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Linux Commands - Linux Shtuff","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/g33kinfo.com\/info\/linux-commands\/","og_locale":"en_US","og_type":"article","og_title":"Linux Commands - Linux Shtuff","og_description":"Privileges sudo command &#8211; run command as root sudo su &#8211; open a root shell sudo su user &#8211; open a shell as user sudo -k &#8211; forget sudo passwords gksudo command &#8211; visual sudo dialog (GNOME) kdesudo command &#8211; visual sudo dialog (KDE) sudo visudo &#8211; edit \/etc\/sudoers gksudo nautilus &#8211; root file manager... Read More","og_url":"https:\/\/g33kinfo.com\/info\/linux-commands\/","og_site_name":"Linux Shtuff","article_publisher":"https:\/\/fb.me\/g33kinf0","article_author":"https:\/\/fb.me\/g33kinf0","article_published_time":"2009-05-27T23:40:15+00:00","author":"g33kadmin","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/drsinger1111","twitter_site":"@drsinger1111","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/g33kinfo.com\/info\/linux-commands\/#article","isPartOf":{"@id":"https:\/\/g33kinfo.com\/info\/linux-commands\/"},"author":{"name":"g33kadmin","@id":"https:\/\/g33kinfo.com\/info\/#\/schema\/person\/c022e4c40b13ea1b678e6f020756f547"},"headline":"Linux Commands","datePublished":"2009-05-27T23:40:15+00:00","mainEntityOfPage":{"@id":"https:\/\/g33kinfo.com\/info\/linux-commands\/"},"wordCount":957,"commentCount":0,"publisher":{"@id":"https:\/\/g33kinfo.com\/info\/#\/schema\/person\/c022e4c40b13ea1b678e6f020756f547"},"articleSection":["General Info"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/g33kinfo.com\/info\/linux-commands\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/g33kinfo.com\/info\/linux-commands\/","url":"https:\/\/g33kinfo.com\/info\/linux-commands\/","name":"Linux Commands - Linux Shtuff","isPartOf":{"@id":"https:\/\/g33kinfo.com\/info\/#website"},"datePublished":"2009-05-27T23:40:15+00:00","breadcrumb":{"@id":"https:\/\/g33kinfo.com\/info\/linux-commands\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/g33kinfo.com\/info\/linux-commands\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/g33kinfo.com\/info\/linux-commands\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/g33kinfo.com\/info\/"},{"@type":"ListItem","position":2,"name":"Linux Commands"}]},{"@type":"WebSite","@id":"https:\/\/g33kinfo.com\/info\/#website","url":"https:\/\/g33kinfo.com\/info\/","name":"Linux Shtuff","description":"Because I have CRS Syndrome...","publisher":{"@id":"https:\/\/g33kinfo.com\/info\/#\/schema\/person\/c022e4c40b13ea1b678e6f020756f547"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/g33kinfo.com\/info\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/g33kinfo.com\/info\/#\/schema\/person\/c022e4c40b13ea1b678e6f020756f547","name":"g33kadmin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/g33kinfo.com\/info\/wp-content\/uploads\/2022\/07\/minion-researchA.gif","url":"https:\/\/g33kinfo.com\/info\/wp-content\/uploads\/2022\/07\/minion-researchA.gif","contentUrl":"https:\/\/g33kinfo.com\/info\/wp-content\/uploads\/2022\/07\/minion-researchA.gif","width":512,"height":512,"caption":"g33kadmin"},"logo":{"@id":"https:\/\/g33kinfo.com\/info\/wp-content\/uploads\/2022\/07\/minion-researchA.gif"},"description":"I am a g33k, Linux blogger, developer, student and Tech Writer for Liquidweb.com\/kb. My passion for all things tech drives my hunt for all the coolz. I often need a vacation after I get back from vacation....","sameAs":["https:\/\/thelinuxreport.com","https:\/\/fb.me\/g33kinf0","https:\/\/x.com\/https:\/\/twitter.com\/drsinger1111"]}]}},"_links":{"self":[{"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/posts\/211","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/comments?post=211"}],"version-history":[{"count":0,"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/posts\/211\/revisions"}],"wp:attachment":[{"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/media?parent=211"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/categories?post=211"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/tags?post=211"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}