Directory Terminal Commands [SOLVED]
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Directory Terminal Commands [SOLVED]
I do have a 12 pages document listing most or all? Terminal commands but honestly I’m lost in there and mostly since I’m a beginner I’m afraid to use commands I don’t really know anything about them. What I want to know is which command will give me a list of programs and their size installed on each of my HDD.
The easy one I know is: lsblk and gives me a list of my HDD
sda = 223GB
sda1 = 28GB
sda2 = 195GB
sdb1 = 149GB
sdc1 = 79GB
But what I want to know is a command(s) to give me a list of programs installed on each HDD including the size of each program like in Windows explorer where you can see all your HDD and programs installed on them.
Thank you
The easy one I know is: lsblk and gives me a list of my HDD
sda = 223GB
sda1 = 28GB
sda2 = 195GB
sdb1 = 149GB
sdc1 = 79GB
But what I want to know is a command(s) to give me a list of programs installed on each HDD including the size of each program like in Windows explorer where you can see all your HDD and programs installed on them.
Thank you
Last edited by LockBot on Wed Feb 08, 2023 11:00 pm, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Nicolas
Re: Directory Terminal Commands
My times with Windows is far away, but I cannot remember having seen in Windows Explorer a listing of all programs and their sizes.
In Linux programs get stored on a number of places; so you would have to add the needed spaces by your own. Open Synaptic and select an installed package. Now look into the properties -> installed files and see yourself, how the files are distributed in the file system.
In Linux programs get stored on a number of places; so you would have to add the needed spaces by your own. Open Synaptic and select an installed package. Now look into the properties -> installed files and see yourself, how the files are distributed in the file system.
Re: Directory Terminal Commands
See if this one works for you:
https://ostechnix.com/how-to-find-insta ... -in-linux/
https://ostechnix.com/how-to-find-insta ... -in-linux/
Re: Directory Terminal Commands
The Synaptic Package Manager is a good program but you must know which program you want to find details. As I mentioned I have 3 hard disks and when I’m in the Terminal the command
lsblk gives me the list of my disks but which command will give me the contents of one of my disks?
Searching I found many Linux Terminal commands like, pwd, ls, ls –la, cd but I found none for a directory list. Perhaps in Linux this doesn’t exist?
lsblk gives me the list of my disks but which command will give me the contents of one of my disks?
Searching I found many Linux Terminal commands like, pwd, ls, ls –la, cd but I found none for a directory list. Perhaps in Linux this doesn’t exist?
Nicolas
Re: Directory Terminal Commands
Your original post does not ask for this, and I suspect you are not asking for it now:I found none for a directory list.
Code: Select all
find -type d
Re: Directory Terminal Commands
Linux programs are or should be installed within / (The main file system).Oskar1224 wrote: ⤴Mon Aug 08, 2022 10:19 am The Synaptic Package Manager is a good program but you must know which program you want to find details. As I mentioned I have 3 hard disks and when I’m in the Terminal the command
lsblk gives me the list of my disks but which command will give me the contents of one of my disks?
Searching I found many Linux Terminal commands like, pwd, ls, ls –la, cd but I found none for a directory list. Perhaps in Linux this doesn’t exist?
So the drive that contains your installation of Linux will be the drive that contains all the installations of programs / applications.
You don't need to know the name of the program in Synaptic, you can filter to show all installed.
Your other drives will be mounted, but applications shouldn't be directly installed to them, they won't be if you installed through apt anyway. Unless you have mounted /usr from another drive and set that up during installation.
I think perhaps we don't understand what results you actually want. Can you give us an example of the information that you want to see? E.g.
Program Name | Install Location | File Size
Is that it?
Re: Directory Terminal Commands
Want a list of all manually installed packages:
Doesn't tell you where they are, most executables go in
Code: Select all
comm -23 <(apt-mark showmanual | sort -u) <(gzip -dc /var/log/installer/initial-status.gz | sed -n 's/^Package: //p' | sort -u)
/usr/bin
.Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
Re: Directory Terminal Commands
Mikeflan: the code “find –type –d” looks promising and I have to investigate further
Nicolai5: with the info you provided the Synaptic Package Manager now looks very promising and I will have to work on it to learn more about the Synaptic..
AndyMH: sorry but I don’t understand the results of the code you provided
Perhaps what I’m looking for is not available in Linux but as I mentioned what I want is a command or commands which will let me know the contents of programs/files on a HDD.
So the command “cd” which I found in the web is good but they don’t include the parameters. If I type in the Terminals cd what is the parameter to go to my lets say HDD? For example
cd/dev/sda1 (means I want to change my current directory to sda1). What is the proper code?
Then assuming now I’m at my sda1 HDD what will be the command to give me the contents of this disk (files name and size)?
Thank you all
Nicolai5: with the info you provided the Synaptic Package Manager now looks very promising and I will have to work on it to learn more about the Synaptic..
AndyMH: sorry but I don’t understand the results of the code you provided
Perhaps what I’m looking for is not available in Linux but as I mentioned what I want is a command or commands which will let me know the contents of programs/files on a HDD.
So the command “cd” which I found in the web is good but they don’t include the parameters. If I type in the Terminals cd what is the parameter to go to my lets say HDD? For example
cd/dev/sda1 (means I want to change my current directory to sda1). What is the proper code?
Then assuming now I’m at my sda1 HDD what will be the command to give me the contents of this disk (files name and size)?
Thank you all
Nicolas
Re: Directory Terminal Commands
It gives you a list of all the packages you have manually installed, e.g. using software manager.
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
Re: Directory Terminal Commands
Hello Oskar
You asked
On Windows, the name of the drive/device (for example
That's why you were trying to use
On Linux, a device (such as
On Linux, DEVICES get MOUNTED as directories. But devices and directories "look the same" (they are written in a similar way with forward slashes) because of the Linux "everything is a file" philosophy.
So... things that start with
For that you need to use
As you see I have 4 devices, 3 of which are mounted. So, if I want to see the files on my
You asked
I think you have a common confusion that many people have coming from Windows.cd/dev/sda1 (means I want to change my current directory to sda1). What is the proper code?
On Windows, the name of the drive/device (for example
C:\
) is also the name of the directory.That's why you were trying to use
cd
on a device.On Linux, a device (such as
/dev/sda1
) is DIFFERENT than a directory (such as /home/spam
).On Linux, DEVICES get MOUNTED as directories. But devices and directories "look the same" (they are written in a similar way with forward slashes) because of the Linux "everything is a file" philosophy.
So... things that start with
/dev
like /dev/sda1
etc. are devices and not directories, you cannot "go into" them to see your files. For that you need to use
cd
on the mount points.This is great, becauselsblk gives me the list of my disks but which command will give me the contents of one of my disks?
lsblk
will show you WHICH DEVICE is mounted at which MOUNT LOCATION:
Code: Select all
➜ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sda 8:0 0 465,8G 0 disk
└─sda1 8:1 0 465,8G 0 part /media/spam/SAMSUNG850EVO
sdb 8:16 0 238,5G 0 disk
└─sdb1 8:17 0 238,5G 0 part
sdc 8:32 0 476,9G 0 disk
└─sdc1 8:33 0 476,9G 0 part /media/spam/CrucialMX100
nvme0n1 259:0 0 465,8G 0 disk
└─nvme0n1p1 259:1 0 465,8G 0 part /
/dev/sdc1
device, I would use:
Code: Select all
cd /media/spam/CrucialMX100
Re: Directory Terminal Commands
Thank you spamegg, your explanation is excellent to make me better understand the Linux files system. So I have to change my thinking about finding files in Linux and along with your example I will also spend more time to understand the Synaptics Package which now looks like a better alternative.
Nicolas
Re: Directory Terminal Commands [SOLVED]
Put a space between 'cd' and the directory or mount point. So like:cd/dev/sda1 (means I want to change my current directory to sda1). What is the proper code?
Code: Select all
cd ~/Documents
After you get to the directory that contains your file, to view the file you do:what I want is a command or commands which will let me know the contents of programs/files on a HDD.
Code: Select all
xed filename
Re: Directory Terminal Commands [SOLVED]
There is an easier method to quickly view the content of files: Mark the file in the file manager and press the space bar. This is true for Cinnamon, I don't know if it works for Mate or XFCE.
Re: Directory Terminal Commands [SOLVED]
You sound like the target audience for LSPKG. Just know that the installed size is literally the
BTW, ...
...is invalid, because
Sorry if that was already stated.
In Windows, you assign filesystems drive letters; to me, that's akin to the act of mounting a filesystem in Linux. In Linux, when you mount a filesystem, you essentially overlay that filesystem's contents over an existing directory, which is known as a mountpoint. The pre-existing directory's contents doesn't get deleted, BTW; it'll all be there when you unmount the filesystem from that mountpoint.
I know some of that has been explained already, but perhaps a reword might help understanding.
Also, '/dev/sda' is your first storage device, but '/dev/sda1' is the first partition on the storage device. Not all storage devices are given the 'sd' format, such as floppy disks (who even uses those?!), optical drives, and NVMe SSDs. These are essentially representations of those devices — hence being in '/dev'. In Linux, we say "everything is a file", because pretty much everything is essentially a file or represented in that way, allowing for some awesome results.
Regarding the command-line, it's important you understand that spacing is important. Spaces separate commands, arguments, flags, strings, etc. That being said, you don't always require specifically one whitespace — you can, for example, often use a Tab (Literal Tab: Ctrl + V, Tab) to separate two fields, although I don't recommend it.
Another thing which might help you is to know that there are programs (IE:
The words flag and option tend to be used synonymously. In man pages, you'll see flags shown as options (typically, under the
Then you have arguments and fields. Technically, both flags and options are also arguments and fields, but it's a bit on the vague side to call them arguments and fields, so for specificity we tend to say flags or options.
My back's getting sore now, so I'll leave it at that.
Installed-Size
value shared by the control files in the Debian packages themselves, but it's nice for getting a general idea. It's strictly for Debian packages, not Flatpaks, Snaps, AppImages, or any of that stuff; for that, you'd need something with a wider reach.BTW, ...
Code: Select all
find –type –d
-d
is the short-form flag for -depth
, leaving -type
without an argument. What you want is:Code: Select all
find -type d
In Windows, you assign filesystems drive letters; to me, that's akin to the act of mounting a filesystem in Linux. In Linux, when you mount a filesystem, you essentially overlay that filesystem's contents over an existing directory, which is known as a mountpoint. The pre-existing directory's contents doesn't get deleted, BTW; it'll all be there when you unmount the filesystem from that mountpoint.
I know some of that has been explained already, but perhaps a reword might help understanding.
Also, '/dev/sda' is your first storage device, but '/dev/sda1' is the first partition on the storage device. Not all storage devices are given the 'sd' format, such as floppy disks (who even uses those?!), optical drives, and NVMe SSDs. These are essentially representations of those devices — hence being in '/dev'. In Linux, we say "everything is a file", because pretty much everything is essentially a file or represented in that way, allowing for some awesome results.
Regarding the command-line, it's important you understand that spacing is important. Spaces separate commands, arguments, flags, strings, etc. That being said, you don't always require specifically one whitespace — you can, for example, often use a Tab (Literal Tab: Ctrl + V, Tab) to separate two fields, although I don't recommend it.
Another thing which might help you is to know that there are programs (IE:
ls
), flags/options (IE: --help
), arguments (IE, the 'd' in: -type d
), expressions, etc. To begin with, you don't have to go too far down the rabbit hole to understand all this, but you should at least learn what a flag/option and an argument is.The words flag and option tend to be used synonymously. In man pages, you'll see flags shown as options (typically, under the
OPTIONS
section). This is the same MS-DOS and IIRC, Powershell. In MS-DOS, for example, you could enter dir /C
(shows numbers like 1,000,000); granted, I'm not sure you'd call /C
a flag, since it doesn't look like one. However, there's a GNU standard, to which some developers don't adhere (IE: those of find
); this standard states that you have long-form and short-form flags which look like --zoinks
and -z
, respectively. The idea is that these flags should do the same thing, affording convenience and potentially clarity. Often, although not always, the letters for the short form flags can be concatenated (stuck together), but not all programs support this (such as LSPKG).Then you have arguments and fields. Technically, both flags and options are also arguments and fields, but it's a bit on the vague side to call them arguments and fields, so for specificity we tend to say flags or options.
My back's getting sore now, so I'll leave it at that.
I'm also Terminalforlife on GitHub.
Re: Directory Terminal Commands [SOLVED]
It reminds me back in the 80’s when I was learning DOS it was hell with primitive PC’s and no Internet. Now I’m in the same stage with Linux but with better PC’s and the Internet which is a global library of everything. With the info I have now its only time and I will get there.
Thanks to all
Thanks to all
Nicolas