Mega-Micro's
Microcomputer projects new & old
Mega-Micros Home
12 Edgefield Close
Redditch B98 7WB
ENGLAND
 
+44 (0)7973 265572
info@mega-micros.co.uk
68000 68030 CPLD FPGA ARM
SHOP        
Systems
68000 CPU
68000 CPU-2
68000 CPU-2.1
Backplane
Backplane-2
Memory
Memory-2
Memory-3
Memory-3.1
Hex Display
Dual 6850
Dual 6850-2
68681
68230
68230-2
ACRTC
IDE
IDE-2
Protoboard
Other Boards
Software
Programming
Documents
Datasheets
Quick Tips
  Monitor
  CP/M-68K
  Linux
Blog
 
 

 

Quick Tips - Linux
Basic Linux Commands
 
Make sure Caps Lock is off - the following commands should be typed in lower case.
 
 
Clearing the screen
 
Type: clear
 
Listing files and directories
 
Type: ls
 
Changing directory
 
Type: cd <directory name> change to the directory specified
Type: cd .. change to the parent directory
Type: cd change to the home directory
 
Copying a file
 
Type: cp <source file> <destination file>
 
Deleting a file
 
Type: rm <file name>
 
Making a directory
 
Type: mkdir <directory name>
 
Deleting a directory
 
Type: rm -r <directory name>
 
Viewing a text file
 
Type: cat <file name>
 
Creating/editing a text file
 
Type: nano <file name>
 
ctrl+o writes the file to disk
ctrl+x quits nano editor
 
Shell Scripts
 

A shell script is a file containing a series of commands. The commands are executed automatically in the order they appear in the file just as if they were typed manually at the command prompt.

 
A shell script is a simple text file structured as follows:
 
#!/bin/bash
command 1
command 2
command n
 
Comments can be added to the file as follows:
 
# comments start with a '#'
 
A message can be displayed by adding the following command:
 
echo "this is my message"
 
It is good practice to save the text/script file with a .sh extension e.g. myscript.sh
 
Script files must be made executable prior to use - use chmod (see below).
 
To run the script type: ./myscript.sh
 
Making a file executable
 
Type: chmod +x <file name>
 
Show the Present/current Working Directory (PWD)
 
Type: pwd
 
Show running processes
 
Type: top
 
ctrl+z quits top
 
Closing the Unix shell (Bash)
 
Type: exit
 
 
Quick Tip:

You can use the up and down arrow keys to scroll through a list of previously typed commands.

 
 
Disclaimer
All hardware designs, software, and information shared on this website is provided "as is"
without warranty of any kind and strictly for personal non-commercial use only.
 
 
Website V0.97 (C) 2021 Mega-Micros
Status: under construction
Mega-Micros Home
12 Edgefield Close
Redditch B98 7WB
ENGLAND
 
+44 (0)7973 265572
info@mega-micros.co.uk