Warning
This page is located in archive.

Basic BASH commands

This page lists a few basic BASH commands that you should be familiar with. Remember that the man command is your friend. Remember that you can search within manual pages (/).

Information about the system

  • uname – shows basic information about the system
    • uname -a – show all
    • uname -r – kernel release
  • lsb_release -a – shows distribution specific information

Filesystem

  • ls – list the current directory
    • ls -la – long listing of all files (inc. hidden)
  • mv – move/rename file
  • cp – copy file
  • rmdir, mkdir – remove/create directory
  • rm – remove file (use with caution!)
    • rm -i – remove interactively (asks)
  • chmod – change file permissions
  • chown – change file group/owner

Users

  • who – show who is logged in
  • w – show who is logged in and their task
  • last – show listing of last logged users

Processes

  • top (interactive, exit by q)
  • ps – report snapshot of current process(es). Note that it has two types of syntax, see man ps
  • kill – send signal to a process

Filters

  • sort
  • uniq
  • awk
  • grep
  • cut
  • wc
    • wc -l – count lines
  • sed
  • tr

Editors

These are up to some level interactive. Make sure you are at least able to edit and save a file using vim or vi. It is sometimes very helpful on some simpler systems.

  • nano
  • pico
  • vim – has 'edit' and 'command' mode. Syntax highlight can be turned on :syn on
  • emacs

Remote Access

  • ssh – secure shell
  • scp – secure copy
  • ping – test response of a machine (i.e.: if it is online)
courses/ae4b33oss/bash_commands.txt · Last modified: 2014/09/30 14:02 by bursam