Skip to content

Instantly share code, notes, and snippets.

@AwsafAlam
Last active May 1, 2018 07:36
Show Gist options
  • Save AwsafAlam/900cdad84fb921e3bd2287d7f6daed85 to your computer and use it in GitHub Desktop.
Save AwsafAlam/900cdad84fb921e3bd2287d7f6daed85 to your computer and use it in GitHub Desktop.
These are a list of basic terminal commands in Linux, and will be updated regularly ar new tools are used

Linux command line


Basic Linux commands

  • clear
  • cd ..
  • cd / ( Straight to root directory )
  • cd Desktop/ ( Press Tab for autocomplete )
  • rm Hello.cpp (deletes the file)
  • rmdir NewFolder (deletes the folder)
  • cat Hello.py ( To view anything directly on command line)

Installing software

sudo apt-get install "Software name"

  • Differnet build tools are available for installation also e.g umake

  • umake can be used to install Android Studio.


Networking tools

Install nmap package Some operations

  • sudo apt-get install nmap
  • ifconfig
  • sudo nmap -sn 192.168.1.0/24

file organization tools

  • mkdir (For creating directories)
  • rmdir (Deleting directories)

Latex commands

  • Compilation : pdflatex demo.tex

  • open pdf : evince demo.pdf

    There are many advantages of compilation in command line. Points out errors and provides a smoother Compilation


Flex

Compilation

  • flex demo.l
  • gcc lex.yy.c -lfl -o demo.out
  • ./demo.out demo.l
It is better to write a script file if we want to write multiple commands at once

gedit script.sh creates a script file. You can now write all your commands here and run at once.

chmod +x script.sh to make the script file executable, admin priviledge is required.

g++ SymbolTable.cpp -o out to compile C++ files.

Arduino

Arduino needs user permission to upload to board

  • sudo adduser <username> dialout
  • sudo chmod a+rw /dev/ttyACM0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment