Linux: Basic Shell Commands
This is a list of most frequently used linux commands.
These are essential commands. Most of them are used everyday by every linux user.
The code here are based on Ubuntu Linux, but 99% of them work in any unix, including Mac OS X.
- ls в†’ list files in current directory
- ls -al в†’ list all files in current dir, including dot files
- ls -al | grep string в†’ show file name matching string
- cd dirPath в†’ change directory
- cd в†’ go to $HOME dir
- cd .. в†’ go up one dir
- pwd в†’ show the current dir
Many of these command’s argument can be either a file name (relative to current directory), or a full file path. For example, ls /usr/local/bin
You can set bash to show current dir path and time in your prompt.
- touch fileName в†’ create a new file, or update timestamp of the file if it exists already.
- rm fileName в†’ delete a file
- rm -r dirName в†’ delete a directory. (careful!)
- cp fileName newFileName в†’ copy a file
- cp -r dirName newName в†’ copy a dir
- mkdir newDirName в†’ create a new dir
- rmdir dirName в†’ delete a dir only if it is empty
- mv fileName newName в†’ rename file, or move to a diff dir.
- du -sh dirName в†’ show dir size. [see Linux: Show Directory Size: du]
- cat fname в†’ display file content
- cat fname | more в†’ view a file by page. Type q to exit. Type h for other keys.
- vi fname в†’ view a file. Type Escape : q to exit. [see vim Basics]
- head fname в†’ view the first few lines of a file. (most useful for big files, e.g. log file.)
- tail fname в†’ view the last few lines of a file.
- tail -f fname в†’ view the last few lines of a growing file, updated continuously. Typically used on log files.
- file fname в†’ report what type of file it is. (For example, text, jpg, png, pdf, вЂ¦.)
- type cmd в†’ show if cmd is a shell built-in or standalone program. For example, type kill . The command type is a built-in bash command, not a standalone shell util. Try type type
- which cmd в†’ show full path of a command, useful for checking if a program is installed (if it’s in the search path in $PATH environment variable.)
- man cmd в†’ view documentation of a command. q to exit. h for help.
- apropos string в†’ search man pages.
- locate fname в†’ find a file by name (using the database see man updatedb ). This is similar to find dir_paths -name “* fname *” but much faster.
- updatedb в†’ update the database used by locate . (this is done automatically. Useful only if you just installed bunch of new commands.)
Linux find executable files by searching the $PATH environment variable. Try echo $PATH . It is a list of dir paths. They are searched in order.
Excutable files must have executable bits on. That is, the вЂњxвЂќ. For example, type ls -l /usr/bin to see them. [see Linux: File Permission System]
The following are for Ubuntu Linux.
- apt-cache search name в†’ find package name for install by вЂњapt-getвЂќ
- apt-cache show name в†’ describe package name
- apt-get install name в†’ install a new program. (usually used with sudo in front)
- apt-get remove name в†’ remove (un-install) a program.
- apt-get purge name в†’ remove a program and its config files.
- dpkg -l в†’ list all installed packages
- apt-get update в†’ sync package index files from sources. (need to do this regularly)
- apt-get upgrade в†’ upgrade all installed packages to latest versions (if any).
- apt-get dist-upgrade в†’ update OS kernel, and others.
To install and compile a new command, here’s the typical steps:
- uname -a в†’ print your OS info.
- df –si в†’ print disk usage.
- tar cvf newName.tar dirPath в†’ tar up a dir.
- tar xvf fileName.tar в†’ untar.
- zip -r newName.zip dirName в†’ zip a dir
- unzip fileName в†’ unzip
- gzip fileName в†’ Compress a file.
- gzip -d fileName в†’ Decompress a file.
- bzip2 fileName в†’ Compress a file.
- bzip2 -d fileName в†’ Decompress a file.
- xz fileName в†’ Compress a file.
- xz -d fileName в†’ Decompress a file.
- Linux: Text Processing: grep, cat, awk, uniq
- Linux: Shell Command Examples: find, xargs
- git Tutorial
- svn Tutorial
Fetching and Sync Remote Files: rsync, unison, wget, curl
- Linux: Sync Across Machines, rsync
- Linux: Download Website: wget, curl
- ps -ef в†’ view running processes
- ps -ef | grep name в†’ find a particular process
- kill pid в†’ quit a program that has process id pid
- kill -s 9 pid в†’ force quit a process
- top в†’ monitor processes with continuous update. q to quit. [see Linux: Monitor Processes: top]
- pstree в†’ show the process parent-child relationship
A better program for monitoring processes than вЂњtopвЂќ is вЂњhtopвЂќ. [see Linux: Monitor Processes, htop]
- sudo commandString в†’ run a command as вЂњrootвЂќ (вЂњrootвЂќ is the name of default admin account.)
- su в†’ switch to вЂњrootвЂќ
- sudo su root в†’ switch to вЂњrootвЂќ. (useful when root isn’t setup as a login account. For example, default Ubuntu)
- chmod 664 fileName в†’ change the perm bits. (664 = rw-rw-r– ; typical text file perm bits)
- chown userName fileName в†’ change owner of a file.
- chgrp groupName fileName в†’ change the group of a file.
- ln -s newPath existingPath в†’ make a symbolic link (aka soft link) of a file. (symbolic link is basically a file path.)
- ln newPath existingPath в†’ create hard link of a file. (Hard link makes 2 files pointing to the same index in the file system (hard disk).)
- shutdown -r 0 в†’ restart machine now. (power off is -P )
- useradd userName в†’ create a new user account. (On Debian based Linuxes, there’s higher-level вЂњadduserвЂќ written in perl.)
- passwd userName в†’ change password for user.
- id userName в†’ show the id number of a user, and all groups he belongs to.
- cat /ect/passwd в†’ list all users
- getent group в†’ list all groups. See getent –help
- date в†’ show current date and time
- date –rfc-3339=seconds в†’ show time stamp in this format: вЂњyyyy-mm-dd hh:mm:ss-07:00вЂќ the last are time offset to UTC.
- w в†’ show who is logged in.
- who -a в†’ list all users that have logged in recently.
- uptime в†’ show how long the system’s been running.
- wc в†’ count the number of chars, words, lines. useful with cat , grep
- source fname в†’ execute a file fname . source fname is equivalent to . fname
- bash в†’ start a new bash. Ctrl + d to exit when done.
- echo $PATH в†’ View value of a environment variable PATH .
- env в†’ show all environment variables
- alias str =” cmd “; в†’ make str as shortcut for cmd . For example, alias l=”ls -al –color”
1 YEAR LIMITED WARRANTY | HEAVY METALS TESTED | USER MANUAL
– Free U.S. shipping for orders $60+
– Ships same day if placed M-F before 2:30pm PST except holidays, with discreet packaging
– Custom duties & fees not included in international shipments Ships to Canada, Europe, Australia and New Zealand
LINX HYPNOS ZERO
WITH CERAMIC PLATE ATOMIZER
“The best vape for extract.”
“Best portable extract vaporizer.”
Extract the taste
Zero fibers, plastics or paints, the Hypnos Zero utilizes its ceramic plate and chamber along with the glass mouthpiece to deliver toxin free vapor.
The powerful ceramic plate heats up instantly and evenly across the surface, offering unparalleled pure flavor.
The uniquely designed heating plate effectively vaporizes, leaving little to zero waste.
No exposed coil makes for safe and easy filling and cleaning, and increases atomizer life span.
Measuring in at 10.7cm (with mouthpiece attached), the Hypnos Zero packs tremendous power in a small body.
1 Hypnos Zero Atomizer
2 Glass Mouthpieces (with 1 filter section)
1 Hypnos Zero Rechargeable Battery
1 USB Charger
1 Hypnos Zero Carrying Case
1 Linx Tool
HYPNOS DIO ATOMIZER
Why does my Hypnos Zero keep flashing white? The Hypnos Zero flashes white 10 times when the battery is depleted. Charge the battery fully before next use.
The battery will also flash 10 times when the power button is held for 15 seconds. This indicates that the overheat protection feature is triggered and your device will be shut off automatically. Press the power button 5 times to turn back on the device. My Hypnos is not working, why is it not producing vapor?
Be sure to use stable extracts that are hard or wax type extracts for best results, runny oils are not recommended.
Apply a small amount (0.05 – 0.1 grams) of extract on the bottom of the atomizer, DO NOT try to fill the chamber, less is more! Hold down the power button while inhaling until you are finished with your hit. Always keep inhaling for five seconds after releasing the power button to draw cool air in to the device.
Store upright with the Cap on when not in use. Always turn the device off when not in use to prevent accidental activation by pressing the power button five times quickly.
For optimum vapor quality, always keep your Linx Hypnos Zero clean. You can find the cleaning video here.
Can I use my own 510 battery? Our atomizers are compatible with most 510 batteries, however some may not make a connection. My plate has dark marks after a few uses, is this normal? It is normal for the plate to turn dark at times. The device will function the same way and it will definitely not affect your vaping experience. Do not try to poke, scratch, push, pull or move the ceramic plate in any way with any tool as this may permanently damage your atomizer. What is the warranty for Hypnos Zero? Hypnos Zero is covered by one year limited warranty. If you have warranty questions or need support, please contact us by submitting a ticket, select “Warranty”. Make sure to include your order number (LNXVPR followed by numbers), product and a detailed description of the issues so we can start the warranty service. Videos or pictures are recommended if available. Please do not tamper any parts of the device as tampering will void your warranty. Also check out our warranty page for detail coverage.Featuring four temperature settings, Linx Hypnos Zero is constructed with medical grade components and a uniquely designed ceramic plate atomizer for pure taste ]]>