Some Useful Linux-commands

Here is some useful linux commands

  1. du -h file
    check the file size
  2. pwd
    show the current directory location
  3. locate file
    find the file name
  4. alias name=”…”
    alias some commands
  5. tar -xzvf file.tar.gz
    -x extract file, -v show extraction process, -f output to given file name, -z using gzip or unzip to extract gz format
  6. cat /proc/cpuinfo
    display information of cpus
  7. nvidia-smi -L
    list the gpus. need to install nvidia first
  8. diff a b
    show difference between a and b files
  9. chmod ugo file-name
    ugo is a oct number used to set the access mode of the file, indicating r (read), w (write), x (executive) mode of the file to different groups of users.
    For example if ugo = 666, then it means user, group and other groups can read, write the file, but can not execute the file.
1
2
3
4
5
6
7
8
9
10
11
12
13
permission to:  user(u)   group(g)   other(o)     
/¯¯¯\ /¯¯¯\ /¯¯¯\
octal: 6 6 6
binary: 1 1 0 1 1 0 1 1 0
what to permit: r w x r w x r w x

binary - 1: enabled, 0: disabled

what to permit - r: read, w: write, x: execute

permission to - user: the owner that create the file/folder
group: the users from group that owner is member
other: all other users

Palmetto Commands: Need to be in login node (name node), not computing node or shell in jupyter Hub

  1. checkquota: check my disk space quota
  2. module avail : list available packages
  3. qstat -xf jobid: check the status of job with id: jobid
  4. qstat -Qf queuename : check status of a queue

References

[1] https://www.runoob.com/linux/linux-comm-tar.html

Comments