Command Line

How to Get List of All Domain User Accounts from Command Line - Windows

To get a list of all user accounts in a domain and export them into a text file, run the following command (you need to have the appropriate permissions to run this command, a domain admin will work):

net user /domain > domain-user-list.txt

This will export a list of all domain users to a text file in the working directory. This should work in any Microsoft Windows Active Directory Domain.

Linux - Find Total and Free Disk Space from Command Line or Terminal

To find the total and free disk space in Linux operating systems such as Ubuntu and openSUSE, you need to use the df command. Here is an example:

 

df -h
 
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda1       913G  481G  386G  56% /
udev            2.0G  4.0K  2.0G   1% /dev
tmpfs           807M  1.2M  805M   1% /run
none            5.0M     0  5.0M   0% /run/lock
none            2.0G  2.7M  2.0G   1% /run/shm
cgroup          2.0G     0  2.0G   0% /sys/fs/cgroup
 
If you run df without any switches, it will give you the same output, but in Kilobytes. If you want to learn how to find total and free disk space in Windows, check out this tutorial.

Find Total and Free Disk Space from Command Line Windows XP - 7 - 2003 - 2008

To find the total and free disk space in all modern versions of Microsoft Windows from the command line, you need to use the fsutil command. Here is an example:

fsutil volume diskfree c:

Total # of free bytes        : 11658346496

Total # of bytes             : 209712050176

Total # of avail free bytes  : 11658346496
 
Unfortunately, there is no way to change the output from bytes to megabytes or gigabytes. If you want to learn how to find total and free disk space in Linux, check out this tutorial.

mv - Move All Files Including . Hidden Files - How To for Linux Unix

By default, the mv command will not move files in the source directory that begin with . (also known as hidden files). If you want to move all files (including hidden files that begin with a dot .), run mv like this:

 mv ./{*,.*} /destination/directory/here 

 ​Below are some examples of a directory structure before and after running mv:

./
├── level1
│   ├── 1
│   │   ├── one.txt
│   │   └── .two.txt
│   ├── 2
│   │   ├── .four.txt
│   │   └── three.txt
│   ├── five.txt
│   └── .six.txt
└── level2

mv ./level1/* ./level2/

./
├── level1
│   └── .six.txt
└── level2
    ├── 1
    │   ├── one.txt
    │   └── .two.txt
    ├── 2
    │   ├── .four.txt
    │   └── three.txt
    └── five.txt

As you see ./level1/.six.txt did not move because it was in the source directory and it was a hidden file. If you were to move it the correct way, it would work and look like this:

mv ./level1/{*,.*} ./level2/

.
├── level1
└── level2
    ├── 1
    │   ├── one.txt
    │   └── .two.txt
    ├── 2
    │   ├── .four.txt
    │   └── three.txt
    ├── five.txt
    └── .six.txt

 

Pages

Subscribe to Command Line