This is a growing list of Linux commands which might come handy for the newbies of Linux.
1. Found out i had to set the date like this:
# date -s 2007.04.08-22:46+0000
2. Mounting
sudo mount -t cifs // < pingable_host_or_ip > / < win_share_name > /build -o user=,domain=,uid=string,gid=string
3. To install linux packages from internet (ubuntu only)
apt-get install
4. To determine what ports the machine is currently listening on
netstat -an | grep -i listen | less
5. Find in files in Linux
find . | xargs grep 'string' -sl
6. To become superuser/root
sudo -i
7. To find a running process using name
ps -aef | grep "searchstring"
8. Alt + F2 opens run window in RHEL
9. To access windows share from linux
smb:///d$
10. To know the last reboot date & time
$ last reboot | head -1
11. To install RPM packages in RHEL
rpm -ivh
12. To un-install RPM package in RHEL
rpm -e
13. To display Linux Kernel version
uname --all
14. To list out the Linux partitions
cat /proc/partitions
15. To list of all writable storage devices in Linux
fdisk -l
16. Installing software from sources in Linux
http://www.tuxfiles.org/linuxhelp/softinstall.html
17. The -T option in the df command displays the file system type.
df -T
18. Open current directory from within the terminal
xdg-open .
18. Find out details about the CPU such as speed, type, no of cores etc
cat /proc/cpuinfo
19. Find out details about memory installed
cat /proc/meminfo
vmstat
23. Try this to reload your current shell
1. Found out i had to set the date like this:
# date -s 2007.04.08-22:46+0000
2. Mounting
sudo mount -t cifs // < pingable_host_or_ip > / < win_share_name > /build -o user=
3. To install linux packages from internet (ubuntu only)
apt-get install
4. To determine what ports the machine is currently listening on
netstat -an | grep -i listen | less
5. Find in files in Linux
find . | xargs grep 'string' -sl
6. To become superuser/root
sudo -i
7. To find a running process using name
ps -aef | grep "searchstring"
8. Alt + F2 opens run window in RHEL
9. To access windows share from linux
smb://
10. To know the last reboot date & time
$ last reboot | head -1
11. To install RPM packages in RHEL
rpm -ivh
12. To un-install RPM package in RHEL
rpm -e
13. To display Linux Kernel version
uname --all
14. To list out the Linux partitions
cat /proc/partitions
15. To list of all writable storage devices in Linux
fdisk -l
16. Installing software from sources in Linux
http://www.tuxfiles.org/linuxhelp/softinstall.html
17. The -T option in the df command displays the file system type.
df -T
18. Open current directory from within the terminal
xdg-open .
18. Find out details about the CPU such as speed, type, no of cores etc
cat /proc/cpuinfo
19. Find out details about memory installed
cat /proc/meminfo
vmstat
20. To list out installed rpms
rpm -qa
21. To Disable firewall on RHEL 7.2
systemctl stop firewalld
systemctl status firewalld
22. Find out the Linux OS/Operating system version
a] /etc/*-release file.
b] lsb_release command.
c] /proc/version file.
rpm -qa
21. To Disable firewall on RHEL 7.2
systemctl stop firewalld
systemctl status firewalld
22. Find out the Linux OS/Operating system version
a] /etc/*-release file.
b] lsb_release command.
c] /proc/version file.
source ~/.profile
24. The following Linux commands can be used to search files by name.find /path -name *.txt
find /path -type f -name test.txt
find /path -name failed*.* -type f
find /path -type f -not -name “*.html”
find / -name “file.txt” -size +4M
find /dev/ -type b -name “sda*”
26. Scanning scsi disks in RHEL
1.Finding the existing disk from fdisk.
24. The following Linux commands can be used to search files by name.find /path -name *.txt
find /path -type f -name test.txt
find /path -name failed*.* -type f
find /path -type f -not -name “*.html”
find / -name “file.txt” -size +4M
find /dev/ -type b -name “sda*”
25. Proxy configuration on Ubuntu Linux
apt-get
,aptitude
, etc. will not obey the environment variables when used normally withsudo
. So separately configure them; create a file called95proxies
in/etc/apt/apt.conf.d/
, and include the following:Acquire::http::proxy "http://myproxy.server.com:8080/"; Acquire::ftp::proxy "ftp://myproxy.server.com:8080/"; Acquire::https::proxy "https://myproxy.server.com:8080/";
26. Scanning scsi disks in RHEL
1.Finding the existing disk from fdisk.
2.Find out how many SCSI controller configured.
In this case,you need to scan host0,host1 & host2.
3.Scan the SCSI disks using below command.
3.Scan the SCSI disks using below command.
4.Verify if the new disks are visible or not.
From Redhat Linux 5.4 onwards, redhat introduced “/usr/bin/rescan-scsi-bus.sh” script to scan all the SCSI bus and update the SCSI layer to reflect new devices.
Install it using yum -y install sg3_utils command.
But most of the time,script will not be able to scan new disks and you need go with echo command.
Useful link on how to configure iSCSI volumes
Comments
Post a Comment