to print screen of a program:
make a small terminal - import screen.jpg - click on the program.
computer can be shut off power while hibernate state.
make a small terminal - import screen.jpg - click on the program.
computer can be shut off power while hibernate state.
ps x
kill -9 20034 // kill -9 forces to kill. kill is just try to kill nicely.
To copy symbolic links:
cp -d
vi search
/p.*.root ->
replace stuffs beginning with lrwx and ending with "root -> "
with "ln -s".
:%s/lrwx.*.root -> /ln -s /gc
ls -gok
check how many files/folders inside a folder.
ls EqTwoJet/ | wc -l
landshark-clued0:~/web_area> ln -s top_write /prj_root/2671/top_write/weigang
landshark-clued0:~/web_area> mkdir d0_private
firfox enable backspace:
about:config --> find "browser.backspace_action" --> change 2 to 0.
in c++, arcsine is asin();
at fermilab, the print command is "kprinter"
actually most of the time it doesn't work. so
1. print page to file "xx.pdf";
2. print pdf.
most of the time this way it's successful.
in term command line,
^a to the beginning
^e to the end.
To edit wiki, just click on "edit", not the pen.
list principles:
> klist
kill sam many jobs:
------------------------------------------------------------------
to subscribe a fermilab mailist:
from my email
to listserv@fnal.gov
subject Subscribe fermiultimate
subscribe fermiultimate my name
------------------------------------------------------------------
Wait 3 hours then play foo.mp3 :
sleep 3h ; mplayer foo.mp3
shell 计算器:
bc or python
scp server:filename . (from server to localhost)
scp filename servername:. (from localhost to server)
accessing windows drives from linux
1. su - to become root user
2. fdisk -l to see all your hard drives and partitions;
anything that has NTFS or FAT32 or VFAT is a windows partition. Ignore Windows 95 Ext'd; they are not really a data partition.
3. mount -t type /dev/partition /mnt (or /media)
e.g.
cd /media
mkdir system
mount -t ntfs /dev/sda1 /media/system
you can now view the contents of that drive.
# ls /media/system/
4. when you are finished with the drive,
umount /mnt
* note to be able to do step 2, you need to have all packages starting with ntfs installed.
env Lists your current environment variables and their settings:
$ whatis env
env (1) - run a program in a modified environment
use alias to list command shortcuts:
$ alias
$ eject
$ pstree
1191 tar -cvf pythia8135_new.tar pythia8135_new/
1194 gzip pythia8135_new.tar
1196 scp pythia8135_new.tar.gz weigang@landshark-clued0.fnal.gov:/work/landshark-clued0/weigang
nan = not a number
to show Chinese characters:
gedit --encoding=gbk .fcitx/config
gcc is located at directory /usr/bin/gcc
$ gcc -v
Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.4.1-4ubuntu9' --with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --enable-multiarch --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.4 --program-suffix=-4.4 --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-targets=all --disable-werror --with-arch-32=i486 --with-tune=generic --enable-checking=release --build=i486-linux-gnu --host=i486-linux-gnu --target=i486-linux-gnu
Thread model: posix
gcc version 4.4.1 (Ubuntu 4.4.1-4ubuntu9)
ps -ef | less
ps aux | less
the length of array should use const.
make all files under a folder readable to everyone:
landshark-clued0:/d0mino> chmod +r weigang -R
to list only hidden files:
ls -a | grep '^\.'
lp -d d0tcn_hp8150_d
lpq
klist -f
qstat -u weigang @d0cabsrv1
# merges and sorts all ".lst" files, then deletes duplicate lines.
the "if-grep" construct:
if grep -q Bash file then echo "File contains at least one occurrence of Bash." fiThe "if COMMAND" construct returns the exit status of COMMAND.
These 3 are equivalent:
if [ $condition1 ] && [ $condition2 ] if [ $condition1 -a $condition2 ] if [[ $condition1 && $condition2 ]]
echo $MACHTYPE $OSTYPE $PS1 $PS2 $PROMPT_COMMAND $TERM $SHELL $PATH: Path to binaries, /usr/bin/, /usr/local/bin/, etc. may store in ~/.bashrc. cat /proc/cpuinfo $ str=adasdf $ echo ${#str} Remove blank lines using grep $ grep -v '^$' input.txt > output.txt
Comments
Post a Comment
https://gengwg.blogspot.com/