Useful Computing Commands

Open a remote terminal on a windows machine
rdesktop -k en-gb hepterm2000
Mount a windows drive in linux
smbclient //hepwin2000s0/users
Mount a windows drive in windows Xp. Enter mountvol to list volumes.
mountvol [drive:]path VolumeName
Unmount volume in Windows Xp.
mountvol [drive:]path /D
Unmount and remove volume label in Windows Xp.
diskpart 
for an interactive session or
diskpart /s unmount.txt
where unmount.txt contains the commands
select disk 0
select volume 2
remove letter L 
exit
Hibernate using a command line in Windows Xp.
rundll32.exe powrprof.dll,SetSuspendState Hibernate
Unmounting a file system when hibernating using a batch script in Windows Xp.
@ECHO on
mountvol L: /D 
for /l %%X in (1,1,500) do echo off
@mountvol L: \\?\Volume{37cf12da-033e-11dd-82b1-806d6172696f}\
for /l %%X in (1,1,500) do echo off
diskpart /s diskpart-unmount.txt
@REM if %errorlevel%==0 (echo SUCcess) Else (echo failure)
if %errorlevel%==0 (rundll32.exe powrprof.dll,SetSuspendState Hibernate) Else (echo failure;pause)
Adjust power management using a command line in Windows Xp.
powercfg 
Get access control list permissions of a file
getfacl the_filename 
Set access control list permissions for a particular user
setfacl -m user:the_user:r-x the_filename 
Strip off filename extension
basename thefile theExt
Strip off filename path
basename thefile
Get user and group ids
id

Ajit Kurup
Last modified: Tue Nov 20 17:05:53 GMT Standard Time 2007