Skip to content

Latest commit

 

History

History
29 lines (15 loc) · 1014 Bytes

File metadata and controls

29 lines (15 loc) · 1014 Bytes

Introduction

  • Basic commands:

    • whoami - prints username

    • hostname - prints name of host

    • pwd - prints current working directory

    • ls - list contents of directory

    • cd - change directory

    • man <command> - manual page for any command

    • info <command> - alternative to man

  • Resources such as Explainshell can be used to understand commands.

  • Commands will also have arguments and options; we can combine multiple single-character options.

  • Text file contents can be viewed using basic programs like more, less and cat.

  • cat can be used to concatenate files as well; for example, cat file1.txt file2.txt will print contents of both files.

  • If we run cat without a filename, it echoes whatever we type.

  • cat can be used with redirectional operators as well; for example cat file1.txt file3.txt > combined.txt redirects the output to 'combined.txt' file.