# Bash

![Linux file system](https://1490490238-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Ma_JYIRuxx8PCv6UaBM%2F-Mj-cEQFm8CcJn-efZ1G%2F-Mj-cKZPhsSxrDGjKP9d%2Fimage.png?alt=media\&token=4b7fd4cf-1d5d-4af0-ae0e-759c73c79794)

## Command lines

`pwd` current dir

`cd` change dir (no path specify will return to home dir)

`ls` list of content

`ls -l` (display long) and `ls -lt` (sort by time) and `ls -ltr` (sort by time and reverse) and `ls -al` (show hidden files too)

`ls *.txt` list only doc ends with .txt

`clear`

`mkdir` new dir

`cp` copy

`rm` remove

`mv` move

`man ls` manual

`history` list of past command

`Control-A` to command start

`Control-A` to command end

`ls -l > ls.out` create ls.out file

`echo "hello" >> ls.out` append "hello" to the end of ls.out file

`less ls.out` read file

`nano` read file

[Define new Linux alias](https://alvinalexander.com/blog/post/linux-unix/create-aliases/)

`alias gs="git status"`
