Skip to content
Tech Shizz Logo

An Engineers Blog

  • TechShizz
  • blog

Linux Terminal Basics

Posted on February 23, 2021 By rich No Comments on Linux Terminal Basics

Here are some of the basics for using Linux Terminal.

To run some of the following commands you need to have administrative access. Once Linux is installed, create a new user and log in as that, this will be the standard account. To run commands that require elevation precede the command with ‘sudo‘.
Before a standard user can do this they must first be added into the group ‘sudo‘. Once the user is created run:
usermod -aG wheel USERNAME
Basic Navigation
pwd – To see which folder you are in
dir – lists files and folders in the current directory
ls – lists files and folders in the current directory
cd    – Change Directory
example: cd Desktop/
cd .. – move up one level
mv – Move a file or it can be used to rename a file too.
Move example: mv sampletext.txt Desktop/
Rename example: mv sampletext.txt justsampletext.txt
cp – justsampletext.txt /root
rm – justsampletext.txt  – Deletes the text file.
Help functions
We can get help on commands and apps. Here we get help on VIM text editor.
vim –help
Or we could use a ‘Man page‘ which is a more verbose help function.
man vim
Network configuration

ifconfig – Interface configuration
Change IP address
First run an ifconfig and identify the interface you need to configure. Ethernet interfaces are named ‘eth0’ , ‘eth1’ and so on. 
ifconfig eth0 10.0.0.99

Any changes wont take effect untill the machine is rebooted or the NIC is disabled and re-enabled.
ifconfig eth0 down
ifconfig eth0 up
Reboot
All of this can also be done in the GUI.
GREP
GREP is used to get an end result. In the example below we can use grep to filter the results of the ls command to anything with ‘NTFS’ in it in the sbin folder.
ls | grep ntfs

ls-grep

Kill
The kill command can be used to terminate processes. I have started VIM and opened another Terminal.
ps -A – Shows list of all running processes. 
We could pipe this into grep to narrow down our search.
ps -A | grep vim

ps -A | grep vim

Now we have the process ID we can terminate it. The “-9” is a semi-graceful way to terminate the process.
kill – 9 1786

If kill -9 does now work, -15 is the most efficient kill value.

Installing applications

If we know the name of an application we can simply install it from the terminal; here we install an text editor called ‘kate’.
apt-get install kate



Post navigation

❮ Previous Post: How to clear a print queue that won’t clear
Next Post: How to disable SIP ALG on a Draytek router ❯

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors

Subscribe to our newsletter!

Recent Posts

  • How to implement a lightning-fast ransomware playbook
  • How to achieve defence in depth in your business
  • How to implement a SecOps team phishing response plan
  • How to block an Office 365 Sign-in correctly
  • Microsoft finally patched serious Exchange 0-day over a month old!

Recent Comments

    Archives

    • November 2022
    • July 2021
    • March 2021
    • February 2021

    Categories

    • Cyber Security
    • Uncategorized

    Meta

    • Log in
    • Entries feed
    • Comments feed
    • WordPress.org

    Copyright © 2023 .

    Theme: Oceanly News Dark by ScriptsTown