LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-11-2009, 02:45 PM   #1
parent's_basement
Member
 
Registered: Dec 2006
Posts: 111

Rep: Reputation: 16
Helpful Linux commands


Hi All,

Whenever I learn a new command, I always write it down so I won't forget it. I was going through my growing commands doc to prune it down a bit and thought my list might be helpful for people new to linux. Many of the commands most people know but some may be new to you. Please feel free to reply with some gems that you find especially helpful. Cheers and happy computing!

-pb

############################################################

alien -iv: [package name] alien converts .rpm to .deb

du -ch: /path/to/folder check file or directory size in total
amount and in human-readable terms.

dpkg-reconfigure fontconfig-config: font quality check

grub-install:*install grub on your drive*

dmesg | more: shows boot-up messages

module-assistant:*module-assistant is the command-line tool for
handling module-source packages that have been prepared for the Debian distribution. It helps users to build and install module package(s) easily for one or more custom kernels.

lsmod: lists loaded kernel modules

lspci: lists info on hardware lshw lists more detail and apt-get install hwinfo for another good tool. mkxf86config for monitor capabilities

umask: set in env.vars. (.bashrc?). Decide what your default environmental file permissions should be for thinks such as touch and text editors. Ex. U: 7 G: 5 O:0. Subtract this number from 777 and the result (027), is your umask

whatis: microscopic man page. Form: whatis mkdir

cmp: create a file, modify it and save it as a different file. use cmp to compare the differences between the two files

df -Th: report file system disk space usage
more /proc/cpuinfo: shows info on the cpu

ddcprobe: monitor info

modprobe “device” **modprobe intelligently adds or removes a module from the Linux kernel: note that for convenience, there is no difference between _ and - in module names
update-alternatives --config (item) check in /etc/alternatives for list.

alsamixer: sound input/output config gdebi

checkinstall: (run in the root directory of a package source tree). checkinstall -D turns most source into a .deb (use dpkg -i to install). The -R option turns it into a .rpm package

tar jxvf: unpacks .tar .bz package in one fell swoop

dpkg -l package* | grep -i ^ii example, lists actual package name so it can be removed (in this case by dpkg)

uname -a finds kernel version

readlink: display value of a symbolic link. The following example shows which driver module controls the eth0 device:

readlink /sys/class/net/eth1/device/driver/module

cat /proc/cpuinfo: *cpu info

apt-get moo: *just kinda fun

ifconfig [interface]*up/down: brings specified nic on or off line

top: shows real-time cpu usage by process. -U username for specific user

apropos: info on man pages- very cool*

stat [filename]: verbose info on files

dpkg --list: shows all dpkg installed packages

df -h or better yet fdisk -l:*List hard drive info/names

ctrl-alt-backspace: kills xserver

runlevel: shows current runlevel

telinit x: change runlevel

sysv-rc-conf: start/stop specifications for init scripts by runlevel. You can also go to the /etc/runlevel and replace the “S” with a “K”

update-grub: updates grub boot menu

gcc --version: gnu compiler version

tzselect:* sets timezone

pmount: ("policy mount") is a wrapper around the standard mount program which permits normal users to mount removable devices without a matching /etc/fstab entry

pstree [process]:*display a tree of processes

dhclient: requests and renews dhcp address from dhcp server


Last edited by parent's_basement; 02-11-2009 at 04:06 PM.
 
Old 02-11-2009, 02:55 PM   #2
pljvaldez
LQ Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 271Reputation: 271Reputation: 271
A few more you may want to add:

lsusb -- list usb devices
lshw -- list more detailed hardware information of your system including chipsets, motherboard manufacturer, RAM details, etc (I had to install this separately from the Debian repos)
 
Old 02-11-2009, 04:08 PM   #3
parent's_basement
Member
 
Registered: Dec 2006
Posts: 111

Original Poster
Rep: Reputation: 16
Thanks for the additions pljvaldez!

-pb
 
Old 02-11-2009, 04:10 PM   #4
GibsoneanNode
Member
 
Registered: Jan 2009
Distribution: Desktop- Debian 4.0
Posts: 43

Rep: Reputation: 16
Hello parent's_basement, you have some really good commands in that list!

Commands
lsb_release -a
#OS and distribution information.
dmesg|grep WORD
#Boot messages piped, where “WORD” is the search subject.
cat /var/log/Xorg.0.log|grep EE
#list errors for the X Window System.
Link
TuxFiles: The Basics: Linux Command Line.
 
Old 02-11-2009, 05:16 PM   #5
alan_ri
Senior Member
 
Registered: Dec 2007
Location: Croatia
Distribution: Debian GNU/Linux
Posts: 1,733
Blog Entries: 5

Rep: Reputation: 127Reputation: 127
Ohh,you must have my favorite in that list...
Code:
find / -name stupid -exec /bin/rm -f '{}' \;
- Remove all stupid files in the system.

UPDATE:just to make things clear if they are not to somebody;if you replace word stupid with for example word john,command will delete all files named john in the system.
Here are few more;
1.
Code:
ls -l | grep Aug | wc -l
- prints the number of files in the current directory modified in August.
2.
Code:
tail -f /var/log/mail.log
- Prints the last few lines of a file and then waits, printing new lines as they are appended to the file. This is great for watching a log file.
3.
Code:
find ~ -name '*.txt' -print
- Look under your home directory for any txt files.
4.
Code:
gpg -c file
- Encrypt file.
5.
Code:
netstat -tup
- List active connections to/from the system.

Last edited by alan_ri; 02-12-2009 at 12:55 PM. Reason: UPDATE
 
Old 02-11-2009, 05:46 PM   #6
Reasa
Member
 
Registered: Aug 2008
Distribution: Slackware
Posts: 53

Rep: Reputation: 16
$cal - calendar
$ls /mnt/cdrom > file_listing - cd/dvd file listing on your hdd. Call it dvd_1 and label the corrspondent dvd with pencil dvd_1 too. To find file in this list use $grep lost_file dvd_1 , or if you are in directory with several file lists $grep lost_file * . Now finding files is easier among those hundreds of discs.

Last edited by Reasa; 02-11-2009 at 05:50 PM.
 
Old 02-11-2009, 07:21 PM   #7
cloud9repo
Member
 
Registered: Oct 2008
Location: Middle TN
Posts: 134

Rep: Reputation: 19
Here's a couple more that I like to employ:

halt
reboot

As su[do], with the addition of '-n or -i', it will either reboot or halt the system. When getting attacked ferociously by hacks and what not, a quick press of Alt+F2, and run one of those in terminal, really helps prevent contamination of settings and config scripts.

The '-n' option tells the sys. there's to be no syncing, and the '-i' shuts down the interface for the network.
 
Old 02-11-2009, 08:25 PM   #8
parent's_basement
Member
 
Registered: Dec 2006
Posts: 111

Original Poster
Rep: Reputation: 16
cloud9repo-

Thanks! Also try these:

init 0 (halts the os)

init 6 (reboots the os)

-pb

Last edited by parent's_basement; 02-11-2009 at 08:27 PM.
 
Old 02-12-2009, 12:17 PM   #9
aquaboot
Member
 
Registered: May 2005
Location: Berkeley, CA.
Distribution: debain freebsd
Posts: 483

Rep: Reputation: 31
Good to see a growing list. This is very helpful.

ab
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Anywhere to go for helpful commands? MooCows Linux - Newbie 7 12-30-2004 05:33 PM
WLAN + Linux Virgin - Need Helpful Advice! ArthurDent Linux - Wireless Networking 18 03-26-2004 11:50 AM


All times are GMT -5. The time now is 05:07 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration