For changing directory / to /etc
[root@pc1 /]# cd /etc
One step back /etc to /
[root@pc1 etc]# cd ..
Go to previous working directory
[root@pc1 /]# cd -
Go to current login user home directory
[root@pc1 etc]# cd ~
Show the contents of /etc in single color
[root@pc1 ~]# dir /etc
Show the contents of /etc in different colors with nature of contents
[root@pc1 ~]# Ls /etc
create a folder on root partition
[root@pc1 ~]# mkdir /disk
Create a folder in /disk
[root@pc1 ~]# mkdir /disk/dir
Create multiple folder in multiple directories with single command
[root@pc1 ~]# mkdir /etc/dir1 /var/dir2 /usr/dir3
Create multiple folder in same directory
[root@pc1 ~]# mkdir dir1 dir2 dir3
Copy a file in directory
[root@pc1 disk]# cp file dir
Copy a file from /disk/file and paste it in /disk/dir/
[root@pc1 disk]# cp /disk/file /disk/dir
Copy a directory with –r option
[root@pc1 disk]# cp -r dir dir2
Copy a file from /disk/file and paste it in /etc with myfile name
[root@pc1 disk]# cp /disk/file /etc/myfile
Remove a file
[root@pc1 disk]# rm file
Remove a file with forcefully option
[root@pc1 disk]# rm –f file
Remove a directory with out –r option and you face will an error
[root@pc1 disk]# rm dir
Remove a directory with –r option
[root@pc1 disk]# rm -r /disk
Remove a directory with forcefully option
[root@pc1 disk]# rm -rf dir
Move /etc/dir1 to /disk/ with different name
[root@pc1 disk]# mv /etc/dir1 /disk/mydir
Rename the folder name mydir to dir
[root@pc1 disk]# mv /disk/mydir /disk/dir
Rename the file name with myfile
[root@pc1 disk]# mv file myfile
Read a file page by page with less command
[root@pc1 disk]# less /etc/grub.conf
Read a file page by page with more command
[root@pc1 disk]# more /etc/qrub.conf
Read first ten lines of grub.conf
[root@pc1 disk]# head /etc/grub.conf
Read last ten lings of grub.conf
[root@pc1 disk]# tail /etc/grub.conf
Read first 12 lines with –n option
[root@pc1 disk]# head -n 12 /etc/grub.conf
Read last 11 lines with –n option
[root@pc1 disk]# tail -n 11 /etc/grub.conf
Copy the contents of /etc/grub.conf in /disk/file
[root@pc1 disk]# cat /etc/grub.conf > /disk/file
Append the contents /etc/mtab in /etc/file
[root@pc1 disk]# cat /etc/mtab >> /disk/file
Merging tow commands with pipe sign output of the first command is input of second command
[root@pc1 disk]# cat /etc/squid/squid.conf I more
Count the total lines of squid.conf
[root@pc1 disk]# cat /etc/squid/squid.conf I wc -L
Show only spool words in squid.conf
[root@pc1 disk]# cat /etc/squid/squid.conf I grep spool
Flush the contents of file
[root@pc1 disk]# cat /dev/null > /var/log/messages
Linux Basic Commands
Saturday, July 31, 2010
Labels:
Linux
Posted by
New Spirit
at
8:20 AM
0
comments
How to install Monitorix in Ubuntu
Sunday, June 6, 2010
Labels:
Linux
Posted by
New Spirit
at
9:03 PM
0
comments
Trick: Enable high-speed USB 2.0 support in your VM
Saturday, August 8, 2009
“"Please upgrade your virtual machine to enable high-speed USB 2.0 support for the device "Removable Disk". An attempt will be made to connect this device to the best available host controller. This may result in an undefined behavior for this device"
In some cases, you can’t upgrade your VM because the menu entry "Upgrade or Change Version" is grey and not changeable. In this case you have to open your vmx-file using your favorite editor and add the following line:
ehci.present = "true"
Save it and restart the VM. You are now able to use your USB 2.0 devices without problems.
Labels:
Linux
Posted by
New Spirit
at
9:10 PM
0
comments
Trick: ssh-xfer: Quickly grabbing files over an existing SSH connection
Monday, August 3, 2009
Labels:
Linux
Posted by
New Spirit
at
9:11 PM
0
comments
Tip: Fedora 11's best five features
Tuesday, March 3, 2009
Labels:
Linux
Posted by
New Spirit
at
9:16 PM
0
comments
How to install FreeNX on Suse 10.0?
Sunday, August 3, 2008
NoMachine NX is a Terminal Server and remote access solution based on a comprising set of enterprise class open source technologies. NX makes it possible to run any graphical application on any operating system across any network connection at incredible speed.
In the workshop setup the NX server is running behind a firewall. You can access it from outside your environment (i.e. the Internet) via an analog or ISDN MODEM or from inside you LAN.
You also need to allow inbound traffic TCP to port 5000.
The workshop setup could look like this:
Labels:
Linux
Posted by
New Spirit
at
9:06 PM
0
comments
Backup and Restore MBR
Tuesday, June 3, 2008
The MBR is a 512 byte segment on the very first sector of your hard drive composed of three parts: 1) the boot code which is 446 bytes long, 2) the partiton table which is 64 btyes long, and 3) the boot code signature which is 2 bytes long. The core of the backup command is dd—which will be familiar to every system administrator, especially to those who intend to clone an entire hard disk. To see all the options type man dd. As we want to back up only the first 512 bytes we need to append some arguments to it. Here is the full command you need (and remember to run it as the root user, su (and sudo for Ubuntu users):
dd if=/dev/hda of=/home/richmondg/mbr_backup bs=512 count=1
dd if=/dev/sda/mbr_backup of=/dev/hda bs=512 count=1
Again, amend sda to read where you saved the MBR and run the command as root. If you wish to kill the MBR altogether, including the partition table, then you can overwrite it with a series of zeros:
dd if=/dev/zero of=/dev/hda bs=512 count=1
If you want to kill the MBR but leave the partition table intact then simply change 512 to 446.
lilo -M /dev/sdx
Labels:
Linux
Posted by
New Spirit
at
9:13 PM
0
comments
Trick: The Perfect Server - Fedora 9
Sunday, February 3, 2008
- Web Server: Apache 2.2.8
- PHP 5.2.5
- Ruby
- Database Server: MySQL 5.0.51
- Mail Server: Postfix
- DNS Server: BIND9 (chrooted)
- FTP Server: proftpd
- POP3/IMAP server: Dovecot
- Webalizer for web site statistics
Labels:
Linux
Posted by
New Spirit
at
9:14 PM
0
comments
Battle of the Elite: openSUSE vs. Mandriva
Tuesday, January 1, 2008
Mandriva Linux 2008 may have convincingly won the battle against openSUSE 10.3 but not unanimously because there’s only one judge and that is me :) So, to those who have experienced using these two distros and can compare which of them is better, feel free to give us some feedback.
Labels:
Linux
Posted by
New Spirit
at
9:19 PM
0
comments
Testing Web application security using Google's ratproxy
- potentially unsafe JSON-like responses
- bad caching headers on sensitive content
- suspicious cross-domain trust relationships
- queries with insufficient XSRF defenses
- suspected or confirmed XSS and data injection vectors
Labels:
Linux
Posted by
New Spirit
at
9:17 PM
0
comments

