Essential Unix Commands for File and Directory Management

Copy a File

  • cp source destination
  • Where source and destination are filenames and may need to refer to full pathnames.
  • Has the effect of copying file source to a new file destination
  • cp source .
  • Has the effect of copying file source into the current directory – the . is shorthand for “here”.

Remove/Delete a File

  • rm file
  • Use this command with caution – files deleted in this way cannot be retrieved.

Rename (Move) a File

  • mv source destination
  • Moves the file source to a new file destination.
  • As well as renaming
Read More

Linux Command Line: Essential Operations and Scripting

1. Relationships:

  • 1: fg% 3-D – Mounted disk
  • 2: B – gzip-compressed
  • 3: unmount – Nothing
  • 4: mke3fs -C – Format
  • 5: tar – Nothing
  • 6: dd if-E – To back up
  • 7: bg% 3 -F – Passing the task
  • 8: tar cvf-A – To package

2. Commands:

  • A: 2 + 2 = expr 2 + 2
  • B: Change user password: passwd ana
  • C: Shut down computer: shutdown -h now
  • D: Change ownership of ejer60 to user antonio: chown antonio ejer60
  • E: Delete all files: rm *
  • F: Change the file name: mv script52 ejer52
  • G: Copy all files starting with “exercise” to the “Exercise”
Read More

Linux Commands and File System Management

Essential Linux Commands and File Management

ULI101: Introduction to UNIX/Linux and the Internet – Week 1, Lesson 2

Basic Linux Command Structure

  • Command Format: command argument1 argument2 ...
    • Examples:
      • pwd: Display current directory.
      • date: Show current date and time.
      • ls: List files in the current directory.
      • ls /etc: List files in /etc directory.
      • ls -l: Detailed file listing in the current directory.
      • ls -l /etc: Detailed file listing in /etc directory.

Getting Help with Commands

  • man command: View manual for
Read More