On my never ending Linux/Unix/Windows knowledge quest, I have learned a few basic commands that have just been really helpful and that I have used very often in the past month while troubleshooting random problems.
Linux
smbmount - mount smb shares
Been in a few tight squeezes with some data I needed off a machine, but my only available storage option is a NAS.
The -a switch displays all filesystems, the -T switch displays the FS type, and the -h switch displys the results in "human readable" formats (such as MB and GB)
The -c switch gives a total of the size of all files in the directory, the -h switch lists size in a human readable format, and the -s switch outputs only the size of the directory, not the files within (it is pointless to use the -c switch with the -s switch unless you really enjoy doing so. Also without the -s switch, the output will be of every file and folder in a directory, which could be very verbose)
Here is how to make a release renew script to make quicken things up a bit:
In a terminal window, type:
Now to make the file executable enter:
Windows
I have also been using Windows to mount network shares through command prompt.
The second command will map a share and use the logon credentials of domain\user, and might prompt you for your password (a-z is the drive letter for the share to be mapped to, you must use a drive letter not currently used).
The third command will delete a specified mapped drive (again, you must specify a drive letter for a-z).
The fourth command will delete all mapped drives.
These are all simple commands, but very useful for me day to day.
Linux
smbmount - mount smb shares
Been in a few tight squeezes with some data I needed off a machine, but my only available storage option is a NAS.
- smbmount //ip/share /mnt/mountpoint -o username=domain\\user,password=pass
- smbmount //192.168.1.10/Backup /mnt/nas -o username=user,password=password
The -a switch displays all filesystems, the -T switch displays the FS type, and the -h switch displys the results in "human readable" formats (such as MB and GB)
- df -a -h -T
The -c switch gives a total of the size of all files in the directory, the -h switch lists size in a human readable format, and the -s switch outputs only the size of the directory, not the files within (it is pointless to use the -c switch with the -s switch unless you really enjoy doing so. Also without the -s switch, the output will be of every file and folder in a directory, which could be very verbose)
- du -c -h /mnt/Backup
- du -h -s /mnt/Backup
Here is how to make a release renew script to make quicken things up a bit:
In a terminal window, type:
- nano /usr/bin/rr
- #!/bin/bash
- echo "Now releasing your IP"
- sudo ipconfig set int BOOTP
- sleep 5
- echo "Renewing your IP"
- sudo ipconfig set int DHCP
- echo "Done!"
Now to make the file executable enter:
- sudo chmod 775 /usr/bin/rr
Windows
I have also been using Windows to mount network shares through command prompt.
- net use
- net use a-z: \\ip\share /USER:domain\user
- net use /DELETE a-z:
- net use /DELETE *
The second command will map a share and use the logon credentials of domain\user, and might prompt you for your password (a-z is the drive letter for the share to be mapped to, you must use a drive letter not currently used).
The third command will delete a specified mapped drive (again, you must specify a drive letter for a-z).
The fourth command will delete all mapped drives.
These are all simple commands, but very useful for me day to day.
0 comments:
Post a Comment