(what command and options did I use to get this output?)
drwx------+ 18 bree staff 612 Aug 10 2012 Music
drwx------+ 14 bree staff 476 Jan 12 10:16 Pictures
drwxr-xr-x+ 6 bree staff 204 Apr 11 2012 Public
drwxr-xr-x+ 6 bree staff 204 Apr 11 2012 Sites
drwxr-xr-x 5 bree staff 170 Aug 10 2012 VirtualBox VMs
I can get permissions for a single file by using ls -l on a single file…
$ ls -l filename.txt
-rw-r--r-- 1 bree wheel 0 Feb 13 17:05 filename.txt
drwxrwxrwx
| | |
rwx | |
u rwx |
g rwx
o
drwxrwxrwx
What are the permissions of this file? →
-rw-r--r-- 1 bree staff 0 Jan 14 16:51 file_name
change permissions
chmod [user, group or world] [plus or minus] [read, write or execute] [filename.sh]
# allow user to execute
chmod u+x filename.sh
# prevent world from writing
chmod o-w filename.txt
change owner and group
chown bree:admins filename.txt
change owner
chown bree filename.txt
change group
chown :admins filename.txt
start a command line txt editor!
nano filename.txt
# <CTRL-X> exit
# <CTRL-O> save
# <CTRL-K> cut
# <CTRL-U> paste
# <CTRL-W> search
show the current date and time
date
show the current calendar month
cal
# for year...
cal 2013
For example, a script called "hello_world.sh"...
#!/bin/bash
# Prints "Hello World!"
echo "Hello World!"
How would I run this? →
./hello_world.sh
Entering commands flash cards x 3 (use set 4)
We’ll do this together, then try downloading it yourself:
Permissions, Editing, Date, Time
Entering commands flash cards x 3 (use set 1234)
We’ll do this together, then try downloading it yourself: