| |
+
How to boot two or more operating system.
-
How to boot two or more operating system. If you have two operating system eg. Windows Me, Dos 6.22, Linux. And are not able to use LILO or ntldr, then you can use any third- party bootloader software eg.XOSL.
|
+
How to add a new user.
-
How to add a new user. The easiest way to create a user is by using useradd, here login name is the name which is used by the user. To do this login as root.
|
+
How to change password.
-
How to change password. The easiest way to change password is by using command passwd. If you want to change password for the current login id, then use passwd and press enter. It will ask your new password. But if you are changing password of another user then use passwd login name.To do this login as root.
|
+
Switch between different login ids.
-
Switch between different login ids. To switch between different login ids use Alt + F1, Alt + F2, Alt + F3, Alt + F4 by this you can log as 4 different users. And if you want ot login as superuser in between then use command su and enter password. And to exit from super user id use exit.
|
+
How to see help .
-
How to see help . If you are looking for help, there are lot of documentation provided, use command man . man stands for manual.
|
+
How to check free space.
-
How to check free space. If you want to check the amount of free disk space on your hard disk, use command df df stands for disk free. If you want to check space taken by particular directory use du /directory. Use different parameters for other options like using du -s filename will check a space taken by a file.
|
+
How to find files fast.
-
How to find files fast. Linux maintains a database of all files on the system that can be quickly searched using locate xyz command, here xyz is the filename you want to find. To locate files faster than run utility updatedb. Run this utility once a week
|
+
Lost password, but you can still login.
-
Lost password, but you can still login. If you have lost you root password, you can still login. When the LILO boot prompt, type linux single where you usually type linux. Now you can use passwd utility for new password. (See for utility password in List of Questions in Linux section)
|
+
How to find disk errors.
-
How to find disk errors. You can check for disk errors by using utility fsck, FileSystem Check. Lost clusters are stored in /lost+found directory.
|
+
Do you want to change Swap Space without repartitioning.
-
Do you want to change Swap Space without repartitioning. If you want to increase Swap Space but do not want to repartition or reinstall Linux then follow steps by using command dd create a file of 64 MB. dd if=/dev/zero of=/FileName bs=1024 count=65536.. By this command you create a file with file name FileName. Initialize it mkswap /FileName 65536 sync Now add this space swapon /FileName The drawback of this method is that you are swapping this file every time you start your computer.
|
+
Do you have memory problem during start up.
-
Do you have memory problem during start up.When the LILO boot prompt, type linux mem=xxxM, here xxx=size of your RAM.
|
+
Familiar with Norton Commander of DOS then try using Midnight Commander.
-
Familiar with Norton Commander of DOS then try using Midnight Commander. If you are a new user of Linux and have worked in Norton Commander of DOS then try working on Midnight Commander. It will give you the same feeling of Norton Commander. Command mc .
|
+
Want to remove LILO from MBR.
-
Want to remove LILO from MBR. Assuming that you have already remove linux partition from hard disk and want to remove LILO boot, boot from DOS disk and run fdisk /mbr, this will restore your boot record.
|
+
Change the boot process.
-
Change the boot process. If you use LILO boot and want to change default boot sequence between linux and dos (assuming the name given to other operating system is Dos and your default boot item is linux) use command lilo -D dos.To do this login as root.
|
+
Want to configure your Sound Card.
-
Want to configure your Sound Card. If you want to configure your sound card use utility sndconfig.
|
+
Error installing linux Boot Partition too big.
-
Error installing linux, Boot Partition too big. This error comes when hard disk size is too big. Solve this problem by making / boot partition in first 8 GB of hard disk.
|
+
Want to boot linux from Windows 9x.
-
Want to boot linux from Windows 9x. Copy the utility dosutils in your hard disk which you can access from Windows. These dosutils comes with mostly all distribution of linux. You can find dosutils in Linux CD. In dosutils folder you will find a batch file. Edit it . loadlin drive:\boot.img image folder root=/dev/hdxylinux boot partition ro read only.
|
+
Mount a file system.
-
Mount a file system. To mount a file system, use command mount -a [-rw] [-t vfstype] -a Mounts all file systems in /etc/fstab. -r mounts the file system in Read only mode. -w mounts the file system in Read \ Write mode. -t fstype indicate the file system type.
|
+
Check the services running.
-
Check the services running. To check the services running, run the utility chkconfig. For gui users, use ntsysv.Eg. chkconfig servicename off , use to switch off the service chkconfig servicename start , use to start the service chkconfig servicename restart , use to restart the service chkconfig -status -all , use to check the status of all servies .
|
+
Increase security by using Firewall.
-
Increase security by using Firewall. Linux comes with its own firewall system iptables. It is a 2.4 kernel feature, which was earlier known as ipchains.Eg. iptables -L.
|
+
Getting problem during ssh authentication
-
Getting problem during ssh authenticationIf you are getting problem in ssh autnetication try, editingfile /etc/ssh/sshd_config and set PasswordAuthentication to yes.
|
+
Want to know which Red Hat Linux version is been installed
-
Want to know which Red Hat Linux version is been installedRun following command on console: cat/etc/redhat-release
|
+
Want to know what is date in Linux system
-
Want to know what is date in Linux systemType date command on console, system will
display date used by the system.
|
+
Editing files in linux in normal mode
-
Editing files in linux in normal mode Use vi filename to open a file in normal mode.
To add text click i (insert mode) which will allow user to modify files. To exit insert mode click Esc.
To exit from vi press:q and click enter to exit from editing mode.
|
+
Modifying date in linux system
-
Modifying date in linux systemIf you want to set date in linux run date MMDDhhmm to set current system date/time. egdate 07280517Note: You need to login as root user.
|
+
Copying files over ssh using scp command line tool
-
Copying files over ssh using scp command line toolscp is simplest command line tool to copy files over ssh.Format for scp:-scp filename user@destinationip:destination file
eg.scp first.txt admin@111.111.11.11:/tmp
|
+
Displaying current working directory in linux
-
Displaying current working directory in linuxType pwd on console to display current working directory
|
+
Creating and removing directories in Linux
-
Creating and removing directories in LinuxTo create new directory use mkdir. To remove use rmdir or rm -r eg.mkdir test creates test directory and rmdir test or rm -r test removes test directory.
|
+
Renaming files in Linux
-
Renaming files in LinuxCommand mv is used to rename a file eg.mv oldfile newfile will rename oldfile to newfile.
|
+
Concatenating files in Linux
-
Concatenating files in LinuxFor cancatenation of files in linux,command cat is used which is multipurpose, let us discuss one by one:i) Displaying contents: cat filename displays contents of a file ii)
Creating new file: cat >filename will create new file filename,click Ctrl-D to exit from entry mode iii)Combining text files: cat file1 file2 >file3 will combine file1 and file2 to file3 iv) Delete contents of file: cat /dev/null >filename will delete contents from
filename.
|
+
Copy files in linux
-
Copy files in linuxCommand cp is used to copy files eg.cp oldfile newfile will copy existing oldfile to newfile.
|
+
Create empty file in Linux
-
Create empty file in LinuxCommand touch is used to create empty file.eg.touch filename creates empty file called filename.
|
+
Change access permissions of a particular file in linux
-
Change access permissions of a particular file in linuxCommand chmod is been used to change access permissions.Format: chmod [options] [Mode] file, one can give options as: -f,--silent,--quiet to supress error messages,-v, --verbose for output a diagnostic for every file processed, -c, --changes like verbose but report only when a change is made and to assign permissions use following numeric modes: the octal (0-7) value is calculated by adding values for each digit read+write+execute = 4+2+1 = 7, read+execute = 4+1 = 5 and read+write = 4+2 = 6 eg. Read permission can be set as chmod 444 file, read, write and execute can be set as chmod 777 file.
|
+
Changing owner of a file in linux
-
Changing owner of a file in linuxCommand chown is been used to change owner of a file. Format: chown [-R] newusername file -R changes permission on files that are in subdirectories of directory that you are currently in. eg. chown user1 filename.txt - This command gives permissions as owner to user user1.
|
+
Displaying last part of file in linux
-
Displaying last part of file in linuxtail is the command used to display last few lines or to monitor a file. Format: tail -f filename -f is the option with the help of which you will have a file continuously appending new lines which is useful while debugging log files. If user wants only 10 lines to be displayed then following command must be used tail -n 10 filename. Similarly any desired number of lines can be displayed.
|
+
Remove folders and its contents recursively
-
Remove folders and its contents recursivelyUse rm -rf foldername command to remove folder and its contents recursively.rm command will remove or delete everything in the current directory without any warning so be sure before firing this command.
|
+
Display currently logged in users in linux
-
Display currently logged in users in linux Type who command on console to display users currently logged in to your linux machine. who am i command displays current user id and name logged in.
|
+
How to search for a file in linux.
-
How to search for a file in linux.Type find / -name filename -print command on console to search location of a file. This command will search files in root directory of file system. If user wants to search files in etc directory then / will be replaced by /etc in command.User has to login as root to search
|
+
How to know kernel version in linux.
-
How to know kernel version in linux.Type uname -a command on console to know kernel version, linux distribution, cpu information and more . If user wants only kernel version as output then switch is replaced by uname -r
|
+
How to display top CPU processes in linux.
-
How to display top CPU processes in linux.Type top command on console to list most CPU-intensive tasks on the system
|
+
How long linux system is been running and who all users are logged in ?
-
How long linux system is been running and who all users are logged in ? Type uptime command on console, output is one line containing following information: how long system has been running, how many users are currently logged in and system load averages for past 1,5 and 15 minutes.
|
+
Check the history of commands executed.
-
Check the history of commands executed.Run command history to display last 500 commands executed previously. To display last n comannds run history n eg. history 10, to check last 10 commands.
|
+
Get information about memory in Linux.
-
Get information about memory in Linux. Run command free, it gives used and free memory usage on screen along with useful information.
|
+
Display kernel messages in Linux.
-
Display kernel messages in Linux.The dmesg command is used to write the kernel messages in Linux. It displays messages from /var/log relative to the most recent boot. Syntax dmesg.
|
+
Display a calendar in Linux.
-
Display a calendar in Linux.To display a calendar, run command cal. Syntax Cal [month] [year]. eg: cal 10 2008 - would display calendar for October 2008.
|
+
Get total amount of disk space used by the specified files and for each subdirectory.
-
Get total amount of disk space used by the specified files and for each subdirectory.Disk Usage report the amount of disk space used by the specified files and for each subdirectory. Syntax du [options]... [file] .... A few most frequently use arguments du -a (all files) du -k (in KB) du -h (Human readable format) du -s (Displays total, not details)
|
+
Execute a program periodically and showing its output full screen.
-
Execute a program periodically and showing its output full screen. To execute a program peridically and see its output, use command watch. Syntax watch [options] command command_options. Few options: -n: Specify an interval to run command -d: Highlight the differences between successive updates.
|
+
How to know hostname of the computer in linux.
-
How to know hostname of the computer in linux.Type hostname command on console to know host name of the computer they are logged into.
|
+
Want to know route of a packet they follow to reach destination.
-
Want to know route of a packet they follow to reach destination.Type traceroute machinename_oripcommand on console to know route of a packet. One can also use tracepath machinename_orip command which is similar to traceroute but this command does not take complicated options. This command is very useful when there are network or router problems.
|
+
How to display status of network or ports in linux.
-
How to display status of network or ports in linux.Using netstat command one can know status of various ports. Options available are: eg. netstat [-a] [-n] [-v] -a - Displays State of all sockets and routing table entries. -n - Displays network addresses as number otherwise are displayed as symbols. -v - Verbose to display added information for sockets and routing table -m - Displays STREAMS statistics -p -Display the address resolution (ARP) tables. -i -Display state of the interfaces that are used for TCP/IP traffic -r - Display routing tables -d -Display state of all interfaces that are under Dynamic Host Configuration Protocol (DHCP) control -D - Show the status of DHCP configured interfaces -P protocol - Limit display of statistics or state of all sockets to those applicable to protocol. -l interface - Display the state of a particular interface. interface can be any valid interface such as ie0 or le0.
|
+
Cancel or kill a process in Linux.
-
Cancel or kill a process in Linux.kill pid command is used to kill a process. pid is the process id. To know the process id run ps command on console, all running processes will be
listed.
|
+
Display contents of a file in Linux, one screen at a time.
-
Display contents of a file in Linux, one screen at a time.Type command more filename
to display file on terminal one screenfull at a time. Command less can also be used for this purpose.
Less is a program similar to more but allows backward movement in the file as well as forward movement. Also, less does not have to read the entire input file before starting, so with large input files it starts up faster than text editors like vi.
|
+
Overview of rpm commands in Linux.
-
Overview of rpm commands in Linux.Commands for installing, uninstalling, upgrading, querying, listing and checking RPM packages on Linux system: i) Install a RPM package with following command: rpm -i packagefile.rpm ii) Uninstall RPM package with following command: rpm -e packagefile.rpm iii) Upgrade RPM package with following command: rpm -Uvh packagefile.rpm iv) Querying all installed package: rpm -qa v) Querying a RPM package with following command: rpm -q packagefilename vi) To display package information use following command: rpm -qi packagefilename vii) To list files in installed package use follwoing command: rpm -ql packagefilename viii) Determine which installed package a particular file belongs to with following command: rpm -qf /usr/bin/filename ix) List files in uninstalled RPM file with following command: rpm -qpl packagefile.rpm x) Check RPM signature package to ensure its integrity and origin with following command: rpm --checksig packagefilename
|
+
Converting and copying a file in linux.
-
Converting and copying a file in linux.By using following command user can convert and copy files in linux dd if=report of=document conv=ebcdic, ucase . Above command converts the input file (if) report from ascii to ebcdic and while converting map alphabetic characters in uppercase and copy them to output file (of) called document. Other options available with dd command are: i) count = n copy only n input records ii) conv = ascii convert ebcdic to ascii iii) conv = lcase convert alphabets to lower case iv) conv = noerror continue processing if error encountered v) skip = n skip n input records before starting copy vi) bs = bytes.
|
+
Want to check who is on the system in Linux.
-
Want to check who is on the system in Linux. Type finger username command followed by name of user account to get information about the user or type finger and press enter to see who is on the system and what are they doing.
|
+
List all the partitions registered on the system in Linux.
-
List all the partitions registered on the system in Linux./b> Type following command cat/proc/partitions on the prompt to list all partitions registered on your Linux system.
|
+
Display Total RAM seen by Linux system.
-
Display Total RAM seen by Linux system. Following command grep MemTotal /proc/meminfo will display total RAM seen by the system.
|
+
Display CPU info of Linux system.
-
Display CPU info of Linux system.Following command grep model name /proc/cpuinfo will display CPU information present in the system.
|
+
List down mounted file systems in Linux.
-
List down mounted file systems in Linux.Use following command to list mounted file systems in Linux mount | column -t .
|
+
Know when your linux system got rebooted last time.
-
Know when your linux system got rebooted last time. Use command last reboot to know when your linux system got rebooted last time.
|
+
Modify a user account in Linux.
-
Modify a user account in Linux.To modify a user account, use command usermod. syntax: usermod [-c comment] [-d home_dir [ -m]] [-e expire_date] [-f inactive_time] [-g initial_group] [-G group[,...]] [-l login_name] [-p passwd] [-s shell] [-u uid [ -o]] [-L|-U] login
|
+
Disable FTP in Linux.
-
Disable FTP in Linux.Edit inetd.conf file in /etc folder and comment ftp. This will not allow connection between a FTP client to another server.
|
+
Sync your hardware clock with the system time in Linux.
-
Sync your hardware clock with the system time in Linux.Use following command to sync your hardware clock with the system time in Linux hwclock --systohc. Use hwclock --show command to read hardware clock and print the result.
|
+
Start/Stop firewall in linux.
-
Start/Stop firewall in linux.To start, stop or restart the firewall in linux, run following commands: start: service iptables start stop: service iptables stop restart: service iptables restart
|
+
Check the status of firewall in linux.
-
Check the status of firewall in linux.To check the status of firewall, run command service iptables status. It will display the message with the firewall status eg. Firewall is stopped.
|