Commands for both RedHat and Ubuntu
Instructions: The ones with * might work only in one version. In Ubuntu, type sudo in order to have root rights
Sound troubleshooting
*alsamixer
Reset command line in case it gets corrupted (for instance after trying to read binary files)
*reset
Kill a process
Find out its pid with: ‘ps -e’ and to kill it: ‘kill -9 pid’
Restart network
/etc/init.d/networking restart (or stop and then start)
Users, groups, passwords
useradd UserName
userdel UserName
passwd UserName
groupadd GroupName
Logins
su - : Root
su UserName
Status of programs. For instance, to know the status of nfs: ‘/etc/init.d/nfs status’
Copy, delete, rename, find files. For directories include ‘-r’
rm FileName: Delete file
sudo find / -name ‘name_file’
cp file Location/file : Copy file into Location given
mv file Location/file : Remove file and place it onto location given
Unmount a USB drive
umount /mnt/usbdrive
Permissions
chmod 666 file_name: read and write rights
chmod 775 file_name: all rights
chmod 700 file_name: make a file executable or
chmod u+x:: executable for current user
chmod 0 file:: restrict access to all users except root
chown user:group file_name: assign a user and a group to a file
Display file info
ls -l : know permissions
ls -a: show hidden files
ls -lh: file size
Network
*/etc/sysconfig/network: SetupHostname
*/etc/sysconfig/network-scripts/ifcfg-eth0: Setup ip address
ifconfig -a: Network info
*setup
Basic Installation Process to install a software
Some programs require specific parameters. For additional info check the “README” files
Uncompress package (zip, tar, tar.gz, …See below HowTo Uncompress)
cd package
./configure
make
make check (to make sure the installation is successfully, not necessary)
make install
If installation fails: make clean
PC features
General info: uname -a
HD: df -h
Kernel: uname -r
Memory: free -m
Partitions: sudo fdisk -l
Systems mounted: mount
Uncompress:
tar -xvfz filename.tar
tar -xvjf filename.tar.bz2
tar -xvzf filename.tar.gz
unzip filename.zip
*RPM packages
rpm -ivh package.rpm : install
rpm -i packag.rpm : install
rpm -Uvh package.scr.rpm: install
rpm -V package.scr.rpm: Verify
rpm -e package: remove
rpm -e –nodeps package: force remove
rpm -qa package: check if package is installed
rpm -qalgrep package: check if package is installed
GENERAL
pwd: current directory
ps: print status
history : history of commands typed (add ” | more” to see them by page)
apropos word: list of topics related to “word”
*ntsysv: run programs at boot time (To check on any service: SPACE)
scp file_name machine_name:directory_destination: copy files using ssh
To copy file_name into machine 10.1.1.0 in the directory tmp ’scp file_name 10.1.1.0:/tmp’
Show all ports open in current machine
netstat -lnptuw
*netstat -nap | grep
No Comments »
No comments yet.
Leave a comment
-
Archives
- August 2008 (5)
- June 2008 (3)
- May 2008 (1)
- April 2008 (1)
-
Categories
-
RSS
Entries RSS
Comments RSS