Why do all the sudo? [was Re: Software updater no longer functional]
Charles IRONS
irons.charles at gmail.com
Sun Jan 29 08:01:25 UTC 2017
On Sat, 2017-01-28 at 16:12 +0100, Ralf Mardorf wrote:
> IMO you should start with the commands "cd", "ls", "cp", "mv", "rm"
> and
> "rmdir" in the /tmp directory and learn to understand "globbing"
> basics
> by only using the "*" wildcard and the "?" wildcard.
>
> To add a directory use the command "mkdir" and to add an empty text
> file
> use "touch".
>
> You might notice the used arguments, that seem to do some magic.
>
> To understand them in combination with the given examples the "
> --help"
> option most commands provide often all is needed to understand what
> they
> are doing.
>
> For example run
>
> ls --help
>
> Reading the following examples doesn't help, but if you are doing
> such
> simple experiments you'll understand it step by step.
>
> [weremouse at moonstudio ~]$ cd /tmp/
> [weremouse at moonstudio tmp]$ mkdir hello_world
> [weremouse at moonstudio tmp]$ cd hello_world/
> [weremouse at moonstudio hello_world]$ ls -l
> total 0
> [weremouse at moonstudio hello_world]$ mkdir dir_1 dir_2
> [weremouse at moonstudio hello_world]$ ls -l
> total 0
> drwxrwxr-x 2 weremouse weremouse 40 Jan 28 15:45 dir_1
> drwxrwxr-x 2 weremouse weremouse 40 Jan 28 15:45 dir_2
> [weremouse at moonstudio hello_world]$ ls -l dir_1/ dir_2/
> dir_1/:
> total 0
>
> dir_2/:
> total 0
> [weremouse at moonstudio hello_world]$ ls -l *
> dir_1:
> total 0
>
> dir_2:
> total 0
> [weremouse at moonstudio hello_world]$ ls -ld *
> drwxrwxr-x 2 weremouse weremouse 40 Jan 28 15:45 dir_1
> drwxrwxr-x 2 weremouse weremouse 40 Jan 28 15:45 dir_2
> [weremouse at moonstudio hello_world]$ touch dir_1/a.txt dir_1/b.txt
> dir_1/.hidden_file.txt
> [weremouse at moonstudio hello_world]$ ls -l *
> dir_1:
> total 0
> -rw-rw-r-- 1 weremouse weremouse 0 Jan 28 15:46 a.txt
> -rw-rw-r-- 1 weremouse weremouse 0 Jan 28 15:46 b.txt
>
> dir_2:
> total 0
> [weremouse at moonstudio hello_world]$ ls -lA *
> dir_1:
> total 0
> -rw-rw-r-- 1 weremouse weremouse 0 Jan 28 15:46 a.txt
> -rw-rw-r-- 1 weremouse weremouse 0 Jan 28 15:46 b.txt
> -rw-rw-r-- 1 weremouse weremouse 0 Jan 28 15:46 .hidden_file.txt
>
> dir_2:
> total 0
> [weremouse at moonstudio hello_world]$ cp dir_1/* dir_2/
> [weremouse at moonstudio hello_world]$ ls -lA *
> dir_1:
> total 0
> -rw-rw-r-- 1 weremouse weremouse 0 Jan 28 15:46 a.txt
> -rw-rw-r-- 1 weremouse weremouse 0 Jan 28 15:46 b.txt
> -rw-rw-r-- 1 weremouse weremouse 0 Jan 28 15:46 .hidden_file.txt
>
> dir_2:
> total 0
> -rw-rw-r-- 1 weremouse weremouse 0 Jan 28 15:47 a.txt
> -rw-rw-r-- 1 weremouse weremouse 0 Jan 28 15:47 b.txt
> [weremouse at moonstudio hello_world]$ ls -lA */*
> -rw-rw-r-- 1 weremouse weremouse 0 Jan 28 15:46 dir_1/a.txt
> -rw-rw-r-- 1 weremouse weremouse 0 Jan 28 15:46 dir_1/b.txt
> -rw-rw-r-- 1 weremouse weremouse 0 Jan 28 15:47 dir_2/a.txt
> -rw-rw-r-- 1 weremouse weremouse 0 Jan 28 15:47 dir_2/b.txt
> [weremouse at moonstudio hello_world]$ ls -lA dir_1/*
> -rw-rw-r-- 1 weremouse weremouse 0 Jan 28 15:46 dir_1/a.txt
> -rw-rw-r-- 1 weremouse weremouse 0 Jan 28 15:46 dir_1/b.txt
> [weremouse at moonstudio hello_world]$ ls -lA dir_2/*
> -rw-rw-r-- 1 weremouse weremouse 0 Jan 28 15:47 dir_2/a.txt
> -rw-rw-r-- 1 weremouse weremouse 0 Jan 28 15:47 dir_2/b.txt
> [weremouse at moonstudio hello_world]$ ls -lA *
> dir_1:
> total 0
> -rw-rw-r-- 1 weremouse weremouse 0 Jan 28 15:46 a.txt
> -rw-rw-r-- 1 weremouse weremouse 0 Jan 28 15:46 b.txt
> -rw-rw-r-- 1 weremouse weremouse 0 Jan 28 15:46 .hidden_file.txt
>
> dir_2:
> total 0
> -rw-rw-r-- 1 weremouse weremouse 0 Jan 28 15:47 a.txt
> -rw-rw-r-- 1 weremouse weremouse 0 Jan 28 15:47 b.txt
> [weremouse at moonstudio hello_world]$ cd dir_1/
> [weremouse at moonstudio dir_1]$ ls -lA *
> -rw-rw-r-- 1 weremouse weremouse 0 Jan 28 15:46 a.txt
> -rw-rw-r-- 1 weremouse weremouse 0 Jan 28 15:46 b.txt
> [weremouse at moonstudio dir_1]$ ls -lA ../*
> ../dir_1:
> total 0
> -rw-rw-r-- 1 weremouse weremouse 0 Jan 28 15:46 a.txt
> -rw-rw-r-- 1 weremouse weremouse 0 Jan 28 15:46 b.txt
> -rw-rw-r-- 1 weremouse weremouse 0 Jan 28 15:46 .hidden_file.txt
>
> ../dir_2:
> total 0
> -rw-rw-r-- 1 weremouse weremouse 0 Jan 28 15:47 a.txt
> -rw-rw-r-- 1 weremouse weremouse 0 Jan 28 15:47 b.txt
> [weremouse at moonstudio dir_1]$ mv a.txt x.txt
> [weremouse at moonstudio dir_1]$ ls -lA *
> -rw-rw-r-- 1 weremouse weremouse 0 Jan 28 15:46 b.txt
> -rw-rw-r-- 1 weremouse weremouse 0 Jan 28 15:46 x.txt
> [weremouse at moonstudio dir_1]$ mv b.txt bb.txt
> [weremouse at moonstudio dir_1]$ ls -lA *
> -rw-rw-r-- 1 weremouse weremouse 0 Jan 28 15:46 bb.txt
> -rw-rw-r-- 1 weremouse weremouse 0 Jan 28 15:46 x.txt
> [weremouse at moonstudio dir_1]$ ls -lA ?????
> -rw-rw-r-- 1 weremouse weremouse 0 Jan 28 15:46 x.txt
> [weremouse at moonstudio dir_1]$ ls -lA ??????
> -rw-rw-r-- 1 weremouse weremouse 0 Jan 28 15:46 bb.txt
> [weremouse at moonstudio dir_1]$ ls -lA ../dir_2/*
> -rw-rw-r-- 1 weremouse weremouse 0 Jan 28 15:47 ../dir_2/a.txt
> -rw-rw-r-- 1 weremouse weremouse 0 Jan 28 15:47 ../dir_2/b.txt
> [weremouse at moonstudio dir_1]$ mv x.txt ../dir_2/
> [weremouse at moonstudio dir_1]$ ls -lA ../dir_2/*
> -rw-rw-r-- 1 weremouse weremouse 0 Jan 28 15:47 ../dir_2/a.txt
> -rw-rw-r-- 1 weremouse weremouse 0 Jan 28 15:47 ../dir_2/b.txt
> -rw-rw-r-- 1 weremouse weremouse 0 Jan 28 15:46 ../dir_2/x.txt
> [weremouse at moonstudio dir_1]$ ls -lA ../dir_1/*
> -rw-rw-r-- 1 weremouse weremouse 0 Jan 28 15:46 ../dir_1/bb.txt
> [weremouse at moonstudio dir_1]$ mv bb.txt ../dir_2/y.txt
> [weremouse at moonstudio dir_1]$ ls -lA ../dir_2/*
> -rw-rw-r-- 1 weremouse weremouse 0 Jan 28 15:47 ../dir_2/a.txt
> -rw-rw-r-- 1 weremouse weremouse 0 Jan 28 15:47 ../dir_2/b.txt
> -rw-rw-r-- 1 weremouse weremouse 0 Jan 28 15:46 ../dir_2/x.txt
> -rw-rw-r-- 1 weremouse weremouse 0 Jan 28 15:46 ../dir_2/y.txt
> [weremouse at moonstudio dir_1]$ ls -lA ../*
> ../dir_1:
> total 0
> -rw-rw-r-- 1 weremouse weremouse 0 Jan 28 15:46 .hidden_file.txt
>
> ../dir_2:
> total 0
> -rw-rw-r-- 1 weremouse weremouse 0 Jan 28 15:47 a.txt
> -rw-rw-r-- 1 weremouse weremouse 0 Jan 28 15:47 b.txt
> -rw-rw-r-- 1 weremouse weremouse 0 Jan 28 15:46 x.txt
> -rw-rw-r-- 1 weremouse weremouse 0 Jan 28 15:46 y.txt
> [weremouse at moonstudio dir_1]$ cd ../
> [weremouse at moonstudio hello_world]$ ls -l
> total 0
> drwxrwxr-x 2 weremouse weremouse 60 Jan 28 16:00 dir_1
> drwxrwxr-x 2 weremouse weremouse 120 Jan 28 16:00 dir_2
> [weremouse at moonstudio hello_world]$ ls -lA dir_1/
> total 0
> -rw-rw-r-- 1 weremouse weremouse 0 Jan 28 15:46 .hidden_file.txt
> [weremouse at moonstudio hello_world]$ rm dir_1/*
> rm: cannot remove 'dir_1/*': No such file or directory
> [weremouse at moonstudio hello_world]$ rm dir_1/.hidden_file.txt
> [weremouse at moonstudio hello_world]$ ls -lA dir_1
> total 0
> [weremouse at moonstudio hello_world]$ ls -l
> total 0
> drwxrwxr-x 2 weremouse weremouse 40 Jan 28 16:04 dir_1
> drwxrwxr-x 2 weremouse weremouse 120 Jan 28 16:00 dir_2
> [weremouse at moonstudio hello_world]$ rm *
> rm: cannot remove 'dir_1': Is a directory
> rm: cannot remove 'dir_2': Is a directory
> [weremouse at moonstudio hello_world]$ rmdir *
> rmdir: failed to remove 'dir_2': Directory not empty
> [weremouse at moonstudio hello_world]$ rm -Ir dir_2/
> rm: remove 1 argument recursively? y
> [weremouse at moonstudio hello_world]$ ls -lA
> total 0
>
> Hi again Ralf & Karl
Whew. You have both suggested a lot of learning exercises. Thanks again
for your willingness.
I am keeping your advice in my Inbox to copy and paste as I learn.
I hope my aim of being a GUI level user most of the time is
acceptable.
I assume Ubuntu is aimed at that level for most users.
So I also get help through AskUbuntu and Community wiki .
That I hope adds to the promotion of Ubuntu usage.
Take care until I get my act together.
irons.charles at gmail.comHome +2783 588 0028
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20170129/67147c57/attachment.html>
More information about the ubuntu-users
mailing list