df

How to access multi-level index in pandas data frame?

落花浮王杯 提交于 2020-06-12 05:59:27
问题 I would like to call those row with same index. so this is the example data frame, arrays = [np.array(['bar', 'bar', 'baz', 'baz', 'foo', 'foo', 'qux', 'qux']), np.array(['one', 'two', 'one', 'two', 'one', 'two', 'one', 'two'])] df = pd.DataFrame(np.random.randn(8, 4), index=arrays) In [16]: df Out[16]: 0 1 2 3 bar one -0.424972 0.567020 0.276232 -1.087401 two -0.673690 0.113648 -1.478427 0.524988 baz one 0.404705 0.577046 -1.715002 -1.039268 two -0.370647 -1.157892 -1.344312 0.844885 foo one

du查看的目录大小与df查看的大小不同的时候用lsof查找

家住魔仙堡 提交于 2020-03-01 03:18:57
首先MAN一下俩个命令,看一下解释的区别: du - estimate file space usage df - report file system disk space usage du估计文件空间占用情况,df报告文件系统磁盘空间使用情况。两个命令所要获取的对象时不同的。在linux下,几乎所有东西都可以称为文件,常规文件,二进制文件,socket流。所以,通常情况下,使用du得到到的根路径文件空间占用情况应当与df得到的文件系统磁盘占用的情况是一直的或者说相差无几。但是在某些情况下却会出现du得到的空间占用情况要远小于df得到的。 后通过查询,发现问题出现在deleted文件上。 root下lsof | grep deleted会发现多多少少有些文件状态出于deleted状态。 [root@eb152 ~]# lsof |grep deleted 进程名 PID USER FD 文件类型 大小(字节) 索引节点 文件名 [(状态)] java 3311 AuSP 8w REG 253,0 778 10879268 ***.log (deleted) java 3311 AuSP 9w REG 253,0 3275 10879269 ***.log (deleted) java 3311 AuSP 10w REG 253,0 0 10879815 ***.log

Execute linux command in java and display output to html table

戏子无情 提交于 2019-12-22 23:07:51
问题 I have jsp code df -h for display disk information on the website. How can I show the output to html with table? Below the code: String[] disk; String line; String process; Process p; BufferedReader input; p = Runtime.getRuntime().exec("df -h"); input = new BufferedReader(new InputStreamReader(p.getInputStream())); input.readLine(); disk = input.readLine().split("\\s+"); <% <tr bgcolor="#f0f0f0"> <td colspan="2"> <b>Disk</b> </td> <td align="center"> <b>Size<b> </td> <td align="center"> <b

mount system call in linux cannot display the mountpoint of file system by df command

谁说我不能喝 提交于 2019-12-13 14:17:41
问题 I am trying to use mount() instead of mount command in my program, I use the following mount() successfully, the result returned success instead of Invalid Argument . int rc = mount("172.16.74.20:/data/redun/snmp","/mnt/data/redun/snmp", "nfs",0,"soft,timeo=2,addr=172.16.74.20"); if (rc != 0) { printf("mount failed, errCode=%d, reason=%s\n",errno, strerror(errno)); } But when I use df -h to check the mountpoint, there are nothing displayed. I found the related device was not mounted yet. What

Linux查看磁盘空间

微笑、不失礼 提交于 2019-12-10 04:03:15
##df命令 使用 df -h 命令可以查看磁盘各分区大小、已使用空间以及挂载点等信息. ##du命令 使用 du 命令可以查看某个目录所占用的磁盘空间大小。常见的用法是: du -sh folder. 来源: oschina 链接: https://my.oschina.net/u/941605/blog/726119

linux 查看磁盘信息

若如初见. 提交于 2019-12-06 12:12:42
more /proc/partitions 查看所有分区信息 more /proc/scsi 查看scsi设备(移动硬盘或U盘)信息 more /proc/diskstats 查看磁盘io信息 查看文件占用的内存: 当磁盘大小超过标准时会有报警提示,这时如果掌握df和du命令是非常明智的选择。 df可以查看一级文件夹大小、使用比例、档案系统及其挂入点,但对文件却无能为力。 du可以查看文件及文件夹的大小。 两者配合使用,非常有效。比如用df查看哪个一级目录过大,然后用df查看文件夹或文件的大小,如此便可迅速确定症结。 [yayug@yayu ~]$ df -h Filesystem Size Used Avail Use% Mounted on /dev/sda1 3.9G 300M 3.4G 8% / /dev/sda7 100G 188M 95G 1% /data0 /dev/sdb1 133G 80G 47G 64% /data1 /dev/sda6 7.8G 218M 7.2G 3% /var /dev/sda5 7.8G 166M 7.2G 3% /tmp /dev/sda3 9.7G 2.5G 6.8G 27% /usr tmpfs 2.0G 0 2.0G 0% /dev/shm 参数 -h 表示使用「Human-readable」的输出,也就是在档案系统大小使用 GB

How can I *only* get the number of bytes available on a disk in bash?

≡放荡痞女 提交于 2019-11-29 14:51:06
df does a great job for an overview. But what if I want to set a variable in a shell script to the number of bytes available on a disk? Example: $ df Filesystem 1K-blocks Used Available Use% Mounted on /dev/sda 1111111111 2222222 33333333 10% / tmpfs 44444444 555 66666666 1% /dev/shm But I just want to return 33333333 (bytes available on / ), not the whole df output. Portably: df -P /dev/sda1 | awk 'NR==2 {print $4}' The -P option ensures that df will print output in the expected format, and will in particular not break the line after the device name even if it's long. Passing the device name

Get free disk space with df to just display free space in kb?

半世苍凉 提交于 2019-11-28 20:21:45
I'm trying to output the amount of free disk space on the filesystem /example . If I run the command df -k /example I can get good information about available disk space in kb but only by being human and actually looking at it. I need to take this data and use it somewhere else in my shell script. I initially thought about using cut but then my script wont be portable to other disks as free disk space will vary and cut will not produce accurate results. How can I get output of just the free disk-space of example in kb? fedorqui To get the output of df to display the data in kb you just need to

How can I *only* get the number of bytes available on a disk in bash?

拜拜、爱过 提交于 2019-11-28 08:45:13
问题 df does a great job for an overview. But what if I want to set a variable in a shell script to the number of bytes available on a disk? Example: $ df Filesystem 1K-blocks Used Available Use% Mounted on /dev/sda 1111111111 2222222 33333333 10% / tmpfs 44444444 555 66666666 1% /dev/shm But I just want to return 33333333 (bytes available on / ), not the whole df output. 回答1: Portably: df -P /dev/sda1 | awk 'NR==2 {print $4}' The -P option ensures that df will print output in the expected format,

Get free disk space with df to just display free space in kb?

寵の児 提交于 2019-11-27 12:51:43
问题 I'm trying to output the amount of free disk space on the filesystem /example . If I run the command df -k /example I can get good information about available disk space in kb but only by being human and actually looking at it. I need to take this data and use it somewhere else in my shell script. I initially thought about using cut but then my script wont be portable to other disks as free disk space will vary and cut will not produce accurate results. How can I get output of just the free