Object management command
2010/11/28 00:20 | by Admin ]
Files (Text Base)
Create new file
#nano filename
#nano /etc filename
#touch filename
#touch /etc filename
To edit file
#nano filename
Read file
#nano filename
#cat filename
#cat filename |more
Read first 10 lines
Command History
2010/11/27 09:50 | by Admin ]
01. Last thousand command display
[root@server ~]# history |more
02. Last ten command display
[root@server ~]# history 10
Once you logout or shutdown your pc your current command history will be saved in to a hidden file in your home folder.
03. See a hidden file
[root@server ~]# cd
[root@server ~]# cat .bash_history
4. To clear History
[root@server ~]# ln -sf /dev/null ~/.bash_history
[root@server ~]# >~/.bash_history
5. Another
1) Another option is link ~/.bash_history to /dev/null:
ln -sf /dev/null ~/.bash_history
2) The sintax is wrong, it shoud say:
ln -sf /dev/null ~/.bash_history
Accessing Windows partitions from Linux
2010/11/27 07:56 | by Admin ]
By default any Linux system will fully support FAT partitions, But when it comes to NTFS some are still NOT supporting by default.
Desktop Editions such as Ubuntu 7.10 and Fedora 8 now fully supporting NTFS (with write support), and the partitions are automatically mounted.
Server Editions such as CentOS 5 and RHEL 5 you have to do the following to access NTFS partitions.
01. Configure RPMFroge 3rd party repository, please read my tutorial about CentOS Repositories.
02. Install the following packages
[root@server ~]# yum install dkms-fuse fuse-ntfs-3g
Accessing the Windows partitions.
01. See what are the current partitions in your system, and figure out what partitions belongs to windows.
[root@server ~]# fdisk -l
Creating a super user with root rights
2010/11/27 07:52 | by Admin ]
Sudo is a program which can be used by normal users to execute programs as super user or any other user. Sudo access is controlled by /etc/sudoers. The users listed in /etc/sudoers file can execute commands with an effective user id of 0 and a group id of root's group.
The file '/etc/sudoers' should be edited with the editor "visudo".
01. First, create a user called "vihost"
#useradd vihost
#passwd vihost
02. To give a specific group of users limited root privileges, edit the file with visudo as follows:
# visudo
03. Go down to the line ‘# User privilege specification‘and add the following line.
uddika ALL=(ALL) ALL
Finding Files On The Command Line
2010/11/17 09:09 | by Admin ]
One of the things I like about Linux is the command line. I have used nautilus, gnome-commander, konqueror, kommander, dolphin and thunar to manage files in Linux and these file managers are great for what they do. But there are times when one simply wants to find a file when working on the command line without having to open a GUI application.
From the find man page:
GNU find searches the directory tree rooted at each given file name by evaluating the given expression from left to right, according to the rules of precedence until the outcome is known at which point find moves on to the next file name.
Find empty directories:
find /path -depth -type d -empty
Find empty files:
find /path -depth -type f -empty
Find a file with a specific name:
find /path -name name_of_file







