For the full name of journals and venue information of conferences, click Conference and Journal Info.
For the collected full-length bib, click egbib collection.
Ubuntu Software Management
raw: dpkg
1 | dpkg -i xxx.deb |
dkpg is raw method to install without solving dependencies and existing software.
mature: apt-get
1 | apt-get install softname1 softname2 softname3…… |
apt-get is built on dkpg without saving the deb file. apt-get can solve dependencies and existing software. Note that when using dkpg, dkpg can circumvent apt-get, so apt-get don’t know the software installed by dkpg.
more mature: aptitude (GUI)
1 | aptitude install softname1 |
aptitude is also built on dkpg and more powerful than apt-get.
Ubuntu Shell Scripts
#!/bin/bash
at the head of file indicates shell type
strict format
For
if [[ $input == "hello" ]]
, note that the space after [[ and before ]] is very strict, since [[]] can be used for matching regular expressionarguments
- $@: stores all the arguments in a list of string
- $*: stores all the arguments as a single string
- $#: stores the number of arguments
- shift: remove the first argument
When starting login or interative shells, certain files will be executed based on the following tables:
For bash:
login-y interactive-y: profile
login-y interactive-n: profile
login-n interactive-y: bashrc
For zsh:
login-y interactive-y: zshenv zprofile zshrc zlogin
login-y interactive-n: zshenv zprofile zlogin
login-n interactive-y: zshenv zshrc
login-n interactive-n: zshenv
Ubuntu Log-in Failure
You may fail to log in Ubuntu due to the following reasons:
/etc/environment or /etc/profile is modified to a wrong format: Just modify them back.
startX is used improperly: run
sudo rm -r .Xauthority*
Tips: use Ctr+Alt+F1~6 corresponding to tty 1~6 to use command line
Ubuntu language
$sudo gedit /etc/default/locale
modify as follows,
1
2LANG="en_US.UTF-8"
LANGUAGE="en_US:en"$locale-gen -en_US:en
log out or reboot
Ubuntu Environment Variable
For user-wide: ~/.profile or ~/.bashrc
For system-wide: /etc/profile
source ~/.bashrc
or source /etc/profile
can make the newly added (not the removed) environment variables for the current cmd window available immediately. However, you need to re-login to make them user-wide or system-wide.
Note that after you sudo su
(not using sudo privilege), the environment variables will be lost. You need to re-login. Because sudo su
will erase newly exported variables.
For permanent system-wide change even after sudo su
, you should modify /etc/environment, which is not recommended. Because /etc/environment cannot recognize intermediate variable such as $JAVA_HOME. Sometimes misusing /etc/environment may result in your failure in login.
Not recommend running sudo su
and then modifying ~/.profile or ~/.bashrc.
Ubuntu Crontab
crontab -l //list crontab
crontab -r //remove crontab
crontab -e //edit crontab
- minute hour day-of-month month day-of-week cmd
- each term can be a single number, e.g., 3, or a range, e.g., 3-6, or a set, e.g., 3,5,7, or interval, e.g., */10
- for example, “ /10 * sh ~/cmd.sh” means executing cmd.sh every 10 minutes.
In windows, the function of contrab can be realized by using “task scheduler”.
Ubuntu Command Lines
Here is a website link to query linux commands.
create new user with home folder
1
adduser XXX
sudo privilege:
vim /etc/sudoers
and add$username ALL=(ALL) ALL
at the bottom.start ssh on the server, the default port is 22
1
2sudo apt-get install openssh-server
sudo/etc/init.d/ssh startlist
1
2
3list -a #including hidden files
list -S #arrange by size
list -t #arrange by timeview text
1
2
3cat
head/tail -n 10 tmp.txt #view the first/last 10 lines
less #more powerful than moreChange the privilege
1
2chmod 777 ./
chmod a+x ./Check disk or file size
1
2df -h
du ./ --max-depth 2 -hCompress or uncompress files, refer to this link.
Grep + regular expression
1
grep [xyz]
Search file
1
2
3
4
5locate "keyword" #fast
find ./ -maxdepth 1 -name "*keyword*"
find ./ -name "*keyword*" -size +50M -size -100M
find ./ -name "*keyword*" -mmin -10 #m:modify min:minute
find ./ -name "*keyword*" -exec rm -r {} \;Pipe commands
1
2
3ls -l | tr -s ' ' | cut -d ' ' -f 2 #tr to truncate space
ls -l | sort -rnk2 #-r:reverse -n:numerical -k:k-th column
ls -l | wc -l #count linexargs:
1
2
3cat python/requirements.txt | xargs -L 1 sudo pip install
find . -name "*.c" | xargs rm -rf
find . -name '*.c' | xargs grep 'stdlib.h'alias: temporary alias command
1
2alias lnew="cd /home/niuli/caffe"
unalias lnewexport: The export command is one of the bash shell built-in commands, which means it is part of your shell.
1
2
3
4
5
6export a=linux.com
echo $a
export -n a #remove variable
printname () { echo "Linuxcareer.com"; }
export -f printname #export functionadd LD_LIBRARY_PATH
1
2echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/usr/local/lib' >> ~/.bashrc
source ~/.bashrcshellscript sample
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25#!/bin/bash
read -p "Please input your first name: "
echo -e "\nYour full name is: $firstname $lastname"
test ! -e $filename && echo "The filename '$filename' DO NOT exist" && exit 0
test -f $filename && filetype="regulare file"
test -d $filename && filetype="directory"
[ "$yn" == "Y" -o "$yn" == "y" ] && echo "OK, continue" && exit 0
if [ "$yn" == "Y" ] || [ "$yn" == "y" ]; then
echo "OK, continue"
elif [ "$yn" == "N" ] || [ "$yn" == "n" ]; then
echo "Oh, interrupt!"
else
echo "I don't know what your choice is"
fi
while [ "$yn" != "yes" -a "$yn" != "YES" ]
do
read -p "Please input yes/YES to stop this program: " yn
done
for animal in dog cat elephant
do
echo "There are ${animal}s.... "
done
Windows Command Lines
zip/unzip
winrar x -y -ibck zip_file_name unzip_file_name
//x means unzip, -y means yes to interrupted queries, -ibck means running in the backgroundgenerate the file list under one folder
dir D:\test /b >list.txt
ordir D:\test /b >list.xls
combine multiple compressed volumes
copy /b logs.tar.gza* logs.tar.gz