Normal view

There are new articles available, click to refresh the page.
Today — 3 June 2025Main stream

闲鱼的开发程序员不是弱智

By: qq9751
2 June 2025 at 01:08
qq9751:

都很聪明。闲鱼 app 安卓端只要更新 app ,聊天记录就无法搜索。闲鱼的 ceo 或者管事人估计从来没有自己在闲鱼卖过东西吧,对卖家收取服务费和软件费,却没有服务好卖家,我作为一个卖家,非常需要这个功能,比如 QQ 微信,升级版本从来不会出现无法搜索聊天记录。闲鱼连基础的聊天功能都有缺陷

Yesterday — 2 June 2025Main stream

闲鱼的开发程序员不是弱智

By: qq9751
2 June 2025 at 01:08
qq9751:

都很聪明。闲鱼 app 安卓端只要更新 app ,聊天记录就无法搜索。闲鱼的 ceo 或者管事人估计从来没有自己在闲鱼卖过东西吧,对卖家收取服务费和软件费,却没有服务好卖家,我作为一个卖家,非常需要这个功能,比如 QQ 微信,升级版本从来不会出现无法搜索聊天记录。闲鱼连基础的聊天功能都有缺陷

Before yesterdayMain stream

数码荔枝关于《关于又被荔枝投诉了这件事》的回应

By: 1ychee
19 May 2025 at 02:15
1ychee:

周末陪孩子出门玩,没怎么关注手机。在游乐园项目排队时,刷到社交媒体上一位热心网友提醒我们关注 V2EX 的这个帖子

当时已是下午 5 点,而我在游乐园中,没有带电脑。

第一次看完原帖,我的感受是「气愤」,怎么张口就来。

  1. 原贴主在 618 前夕,对我们几个月前投诉其多个店铺的 Bartender 与 Vidjuice 后又撤诉的情况进行了严重误导,但对事件的核心部分却刻意回避。

  2. 原帖提及的软件开发商( Downie / Bartender / Vidjuice )均已充分授权「数码荔枝」移除中国互联网上的盗版与「非授权渠道」。原贴主对此早就心知肚明,却刻意回避。

  3. 原贴主硬将第三方拉入事件。我们与同行确实存在竞争关系,但在公开场合,我们从不指名道姓。我不清楚同行是否提前知晓原贴主的发帖行为,或是否与其有所沟通或指使。

因此,我们决定公开相关事实。原帖中对我们形象的错误塑造,也将不攻自破。

数码荔枝注册软件著作权移除盗版 & 非授权渠道的正当性

首先,我们收入不算高,且销售受疫情影响较大:对大环境的相同共识下,你也要吃饭,也买添置生活必需品,但你真的可以省钱不买软件。这是一种无奈,我们能理解。

同时,由于“人人都应有副业”的观点被宣扬,过去几年 (尤其去年),淘宝上的盗版店铺数量陡增。「数码荔枝」销售的正版软件动辄上百元,相同软件的盗版仅需 1-5 元。

此外,部分软件激活码可激活 2-5 台设备。一些店铺将一个激活码直接拆卖给多个顾客。不仅价格便宜,且能够正常激活官网下载的软件版本 —— 只要使用店家提供的特定邮箱或其他信息。但我想,所有软件开发商都会认为这种行为违反了用户协议吧?

总之,以上这些事情发生,对我们的营收造成了长期挑战。部分合作许久的国内外开发商也遇到相似困境。他们询问我们是否有办法处理国内的盗版问题。

我们首先想到的方案,就是当年苏州某公司采用的,即,注册软件著作权用于投诉。唯一问题在于,当初苏州某公司在行动前,可能并未提前告知对应开发商,或其行为本身可能并未获得许可,所以才引来了非议。但「未告知」的原因不难猜测:软件开发商需要对代理商多大的信任,才能允许后者去注册软件的软件著作权呢?

「数码荔枝」很幸运,多个开发商与我们额外签订了 IPP (知识产权保护) 协议。这份协议中,所有相关开发商均已充分了解并授权「数码荔枝」能以自身作为权利主体,注册对应软件在中国的著作权,并用于且仅用于移除国内的盗版 &「非授权渠道」。

这些开发商也在其官网发布了相关申明,其中包含了我们所注册的著作权证书。以下是 原帖 所提的三款软件的官网申明:

以上申明链接,我们也在每次投诉盗版 & 「非授权渠道」时附在投诉附件中,以向被投诉店铺展示我们投诉的正当性。原帖主不可能没看到,如下

数码荔枝为什么总在强调「非授权」渠道

如果一个店铺以 5 元销售一款原价 100 元的软件,那么很容易判断其为盗版。

但如果标价是 60 元呢?这时可能就不太确定了:

  • 也许销售的仍然是 5 元同款的破解网盘链接?
  • 也许是“一号多卖”?
  • 也许是通过黑卡盗刷官网购买?
  • 也许是薅开发商在其他国家进行的限时促销或折扣,再转卖?

这种情况下的鉴定与判断确实更加复杂。因此,我们的解决办法是,只与我们拥有独家代理关系 (至少曾经是) 的软件开发商签署 IPP 协议。这样,理论上来说,只要一个店铺销售了我们独家代理的软件,但并未获得我们的销售许可(例如未从我们这边进货),就能被简单判断为「非授权」渠道,从而进行投诉。

当然,我们并非一刀切,而是会根据实际情况酌情处理。原帖中的只言片语也部分印证了这一点,但还不够全面,因此我们在此具体展开说明。

关于原帖有关 Bartender 投诉的说明

我们在 2025 年 3 月初,根据价格与经验,投诉了一批 Bartender 的盗版 & 「非授权店铺」。

3 月 11 日,原帖主在收到投诉后,提交了申诉内容,称其商品来源于我们的另一同行。基于这一情况,我们进行了撤诉,如下图所示:

需说明,我们与开发商签订的销售合同明确约定,Bartender 软件在国内的零售价为 109 元,而原帖主店铺当时的售价为 80.1 元,远低于合同规定的价格。

为进一步核实情况,我们向该店铺购买了一个 Bartender 商品,其发送的货品,确实是某同行的兑换码。接着,我们将这一情况告知 Bartender 开发商,希望他们与该同行沟通,整改旗下二级经销商乱价问题,如下图:

请注意,上方邮件截图中,我们明确告知开发商「虽然该店铺乱价,但是因为其发货内容确实来自于我们同行,所以是正版,所以我们撤诉

各位朋友,请问我们在上述所有行为中,是否存在任何不妥?如果有,请指出:

  • 我们发现疑似「非授权渠道」后,基于合理判断进行了投诉,并在了解情况后及时撤诉;
  • 我们委托开发商与某同行沟通,处理旗下二级经销商的乱价问题,以符合合同约定并维护市场秩序。

关于原帖有关 VidJuice 投诉的说明

有关 VidJuice UniTube 的事情就更是离谱到家。

我们在 2025 年 1 月初,根据价格与经验,投诉了一批 Vidjuice 的盗版 & 「非授权店铺」。

然后,VidJuice 的开发商就找我们聊天,其核心思想就是:

  • 这些店铺都是从我们某同行进货的;
  • VidJuice 开发商已经知晓,这些店铺的 VidJuice 都是一号多卖的,或乱价;
  • VidJuice 开发商因为各种顾虑,希望我们撤诉,即便他知道这些店铺存在上述问题;

然后,我们直接把 4 个投诉全部撤销了,并通过邮件与开发商确认了其中两个,包括原贴主的店铺 (与上面 Bartender 的店铺还不是同一家淘宝店)。

以下是最后的邮件以及微信聊天记录,我们仅隐去 VidJuice 开发者所顾虑的地方,以及某同行,以及所有四家店铺的名字。

华为鸿蒙电脑:要抓住「可能性」,也要抓住「确定性」

By: 苏伟鸿
13 May 2025 at 12:00

如果说,2024 年是「鸿蒙」元年——短短一年内,鸿蒙5 走上历史舞台,完成了一个全新操作系统从零到一,汇聚星河的全过程。

那么,2025 年就是「鸿蒙终端」的元年——不久前,华为发布了首款搭载鸿蒙5 的华为Pura X,阔折叠的全新产品形态揭示了鸿蒙生态的巨大潜能。

而现在,一个更为重要的鸿蒙设备正式登场——鸿蒙电脑,这正标志着华为终端全面迈入鸿蒙时代。

电脑,鸿蒙化的重要一环

上周,爱范儿参加了鸿蒙电脑的媒体沟通会,并深度体验了鸿蒙电脑——鸿蒙操作系统在电脑端带给我们的体验,让我们感受到了电脑作为鸿蒙版图重要一环,未来将会在互联、AI 上的带来革新性的体验。

在我记忆里,还没有哪个桌面操作系统,可以在亮相当天就提供成熟完善的硬件平台,并且已经有了初步的应用生态。

罗马并非一日建成,鸿蒙电脑已经在华为内部秘密筹备多时。

2021 年,在鸿蒙系统小有所成时,鸿蒙电脑的操作系统原型也被提上日程,这也是华为首次对自研电脑系统展开探索——鸿蒙致力于成为「面向下一个十年的全场景智能操作系统」,而装机量巨大的个人电脑,自然是鸿蒙生态当中的重要一环。

那一年,搭载鸿蒙系统的设备已经达到 1.5 亿台,并且还在持续高速发展,庞大的设备基础也成为了鸿蒙能够继续持续开疆拓土的重要因素。

两年后,华为Mate 60 系列发售,意味着华为已过万重山,也为鸿蒙电脑的落地扫清了障碍。历经三年的系统原型和工程机探索,鸿蒙电脑在 2023 年就已经进入了商用机的筹备阶段。

去年,「鸿蒙操作系统」以先行者的姿态正式发布,不到一年时间里就实现了应用生态从零到万的突破。目前,已经有超 2 万个鸿蒙应用及元服务上架,这样快速建成生态的能力成为了鸿蒙电脑能够顺利诞生的另一个重要因素。

所以鸿蒙电脑的亮相,并不是「一夜爆红」,而是多年的积累。

事实上,电脑产品线,一直是华为终端生态中的重要一环。

如果你用过搭载 Windows 系统的华为电脑,一定对内置的「华为电脑管家」印象深刻——这个神奇的应用,能够让 Windows 电脑与鸿蒙手机、平板进行多屏协同、数据共享等生态互联功能。

只是「华为电脑管家」终究只是一种过渡的方案,电脑和手机上跑的始终是两套系统,在手机备忘录上记录的内容,不会实时出现在电脑上,更不用提更自然的应用流转、键鼠共享这些进阶功能。

只有完全基于鸿蒙生态进行重新思考的电脑产品,才能真正成为鸿蒙生态的一环,才能打造华为办公的新体验。

对于数以亿计的华为鸿蒙用户而言,鸿蒙电脑也是一个众望所归的结果。

据市场研究机构 Canalys 发布的数据显示,2024 年第一季度中国大陆 PC 市场出货量为 795 万台,其中华为的市场份额约 11%,超越了惠普、戴尔和华硕,成为中国出货量第二的 PC 品牌,甚至一度占据了国内轻薄本市场份额的 25%。

▲ 图源:Canalys

如何为庞大的存量用户提供更加差异化的办公体验,以及如何促进更加巨大的潜在用户转化?

鸿蒙电脑就是唯一解。

基于鸿蒙生态的重新思考

虽然鸿蒙电脑才问世一周,却具有相当的完成度。

它不只有花架子,而是已经可以满足部分生产力的高效工具。

鸿蒙电脑既是对鸿蒙生态的补齐,本身也得益于这个逐步完善的鸿蒙生态。

独行快,众行远,一个操作系统能不能长久,离不开应用生态的支持。基于鸿蒙电脑开发的应用,才是更好利用这个平台的可能性。

对于开发者来说,鸿蒙电脑意味着一个全新的市场的形成。目前已经有 150 多个鸿蒙电脑专属应用正在加速适配,300 多个融合生态应用完成适配,到年底这个数字会超过 2000 个。

其中不少应用,不是单纯从其他平台简单迁移到鸿蒙电脑上,而是开发者和华为合作,打造出具有独特功能的鸿蒙应用。

由于和鸿蒙智能小艺助手深度结合,作为第三方应用的 WPS Office 应用,用户也可以通过系统小艺助手的对话框,直接用简单的自然语言指令,调用 WPS AI 生成大纲和 PPT 模板。

而像飞书、中望 CAD 等应用,则利用了鸿蒙生态「一次开发,多端部署」的优势,实现「应用接续」的功能,手机端的线上会议或者图纸,点击一下就能无缝转移到电脑上,免去了繁琐的重新打开、进入流程。

不管是手机还是电脑,鸿蒙生态不是独奏,而是多方合奏才能形成的交响乐。

如果说,应用生态是需要一招一式日积月累的内功,那么 AI 带来的智能操作,以及鸿蒙生态的无缝体验,就都是鸿蒙电脑人无我有的法宝。

作为后起之秀的鸿蒙电脑,反而有机会在 AI 时代弯道超车,因为现存的电脑操作系统,原型诞生于半个世纪以前,几十年来修修补补,本就不是为 AI 而生。

作为 AI 时代诞生的产品,鸿蒙电脑则有着难以比拟的 AI 体验。

不管是文字还是文件,通过鼠标选中后,右键都能直接发送到小艺助手进行 AI 分析;系统全局的 AI 搜索,可以通过关键字提示或者提问的形式,将特定的文件,从电脑中精准检索出来。

以及一个第三方 AI 助手无法实现的系统级能力:小艺设备专家,只需要用户说出指令,就能让小艺实现复杂的电脑系统设置,具有重构用户使用习惯的潜力。

鸿蒙手机、平板用户接触到鸿蒙电脑,就能发现这个原本应该是陌生的系统,充满了自己熟悉的元素,甚至原本在这些触控设备上的操作,也能无缝迁移到鸿蒙电脑上。

由于运行的是一个系统,鼠标、键盘、剪贴板以及文件能够低延迟自然地在手机、电脑、平板三端流转。

一种前所未有的全新协同模式「手眼同行」也得以解锁:当用户看向平板、手机等其他华为设备的屏幕,只要点一下 Ctrl 按键,就能将鼠标转移。

这种人无我有的独家生态互联体验,不仅能吸引用户选择鸿蒙手机、鸿蒙电脑,更是留住用户人心的核心优势。

这恰恰说明,鸿蒙电脑的目标不仅是翻越最高的山,更想成为流得最远的河。

要抓住「可能性」,也要抓住确定性

57 年前,美国计算机科学家道格拉斯·恩格尔巴特演示了一套被称为「联机系统」的计算机硬件和软件系统,包含了窗口、超文本、鼠标等图形用户界面元素,对现代计算机启发意义巨大,因而这套系统又被称为「演示之母」。

▲ 图源:Hackaday

这套系统催生了施乐 PARC 的计算机演示项目,最终影响到了两家公司各自的图形用户界面操作系统诞生,一家叫苹果,另一家叫微软。

作为一个发展了数十年之久的领域,电脑操作系统的格局基本稳定。根据去年的报告,微软 Windows 占领了这个市场超过 70% 的份额,苹果 Mac 抢走剩下的 15%,剩下 ChromeOS、Linux 等小众系统夹缝生存。

移动互联网时代,在手机、平板等移动品类终端的冲击下,个人电脑市场每年以不到 5% 的低速增长,牌桌上剩下的还都是那几个老牌厂商。

华为进军电脑产品不到十年的时间,就成功跻身成为头部玩家,本身已经实属不易,而开发电脑操作系统,想要在这个几乎停滞的计算机系统中获得一席之地,更是一件吃力不讨好的苦差事。

电脑和智能手机不同,后者销量高、利润空间大,足以撑起从硬件到软件的庞大产业链条。

而个人电脑产品,在长期竞争中已经不具备太多利润空间,为此付出的高昂成本也面临难以回收利润的风险。

但作为鸿蒙生态的重要拼图,华为依旧选择打造鸿蒙电脑,进一步推进终端全面鸿蒙化——其背后,是华为一万多名工程师、2700 多项核心专利、20 多家研究所整整五年的努力。

全面迈入鸿蒙时代的华为,也抓住了更多的「可能性」。

一个包罗万象的操作系统,意味着软件和产品不再是相互制约的关系,创作者们可以自由发挥想象力,以用户体验为原点,创造出全新的物种——阔折叠手机 Pura X 的热销,足以证明全面鸿蒙化蕴含的无限潜能。

时至今日,我们只是见到了轻薄笔记本形态的华为鸿蒙电脑,也许在不久的未来,我们就会看到更多不同的鸿蒙电脑。这也意味着能开发更多新应用,创造更多新机遇——对用户来说,有更多新选择,永远不是坏事。

倘若我们把视角置于更大的时间尺度,会发现另一条草蛇灰线:

在数字时代,操作系统就如土地一般重要,有了土地,才能打地基,才可建高楼,才有机会枝繁叶茂,并惠及所有生态伙伴。

在这个局势愈发多变的当下,牌桌可能会被掀翻,选项或许会被收回,而鸿蒙化更大的价值,是让我们能牢牢抓住这种「确定性」。

而这,需要生态里每个人的托举。

#欢迎关注爱范儿官方微信公众号:爱范儿(微信号:ifanr),更多精彩内容第一时间为您奉上。

爱范儿 | 原文链接 · 查看评论 · 新浪微博


AI 会促使设计师成为更完整的人

By: Steven
28 March 2023 at 00:32

最近关于 AIGC 的关注度太高了,自己也时不时会抽空去了解一些情况,或者尝试去用一些工具。很多关于 AI 要替代人的观点大行其道,也一直有不少 AI 要让设计师失业的看法在坊间流传。但我自己的感受和看法是:

在 Midjourney、Stable Diffusion、ChatGPT 这些 AI 工具出现后,「手头功夫」并没有因此丧失意义,它们只是不再具备作为门槛的价值,但依旧是重要的前提。因为「手头功夫」是培养我们发掘问题、判断优劣和快速取舍的重要训练,缺少这部分锻炼,会让人在这一系列 AI 工具面前感到无力。准确地识别问题并提出诉求,这是未来教育的重中之重,也会反过来强调人的价值。

正好,前段时间后浪送了我一本书,是前微软包容性设计的首席总监 Kat Holmes 写的《误配》。一边看这本书,我就一边在结合自己的工作和最近关于 AIGC 的思考,我觉得这本书里提倡的理念,正好回应了当下的舆论思潮。

大部分谈论设计的书,都在试图通过图形和案例来构建一类理论和范式。但在这个 AIGC 日进八万步的新时代里,设计师要以什么身份来参与?我认为所有的既定范式,都会在三到五年之内被全部击碎。串联、融汇、杂交才是新世界的主流,创作者的身份将愈加模糊,甲乙方的界限也会逐渐消失或扭转。怎么回应这样的快速变化?我觉得《误配》这本首版于五年前的「旧书」,提出了很适合当下思考的母题:

设计行为、设计师、设计对象以及新技术之间,如何在智能化浪潮里,互相包容和一起进化?

这本书没有给出直接的答案,但对于有三年以上工作经验的设计师而言,带着经验、问题和困难去阅读,会有启发和收获。「物」的旧体系正在溃散,「系统」和「生态」将是历史的新主角。旧时代的残党,可以下船了。

昨天在各个社交媒体上发了一下自己的读书感受,因为被后浪的微博官号转发了,于是被这本书的译者何盈女士注意到。正巧我的朋友宋喆在刷朋友圈时看到她的这条寻人启事,就这么阴差阳错地跟她直接联系上了。

这种「地球村」的感觉很妙!

这更坚定了我今年一定要 重新启动设计纪录片 的决心了!

Linux Command Line Reference for Common Operations (2)

By: Onlyone
13 December 2011 at 12:54

My previous reference for practical Linux commands was surprisingly popular
with over 3.5 million hits in nearly 5 years. So I've decided to start compiling
another list of somewhat more involved/esoteric commands.
Examples marked with • are valid/safe to paste without modification into a terminal, so
you may want to keep a terminal window open while reading this so you can cut & paste.
CommandDescription
grep . /proc/sys/net/ipv4/*List the contents of flag files
set | grep $USERSearch current environment
tr '\0' '\n' < /proc/$$/environDisplay the startup environment for any process
echo $PATH | tr : '\n'Display the $PATH one per line
kill -0 $$ && echo process exists and can accept signalsCheck for the existence of a process (pid)
find /etc -readable | xargs less -K -p'*ntp' -j $((${LINES:-25}/2))Search paths and data with full context. Use n to iterate
Low impact admin
#apt-get install "package" -o Acquire::http::Dl-Limit=42 \
-o Acquire::Queue-mode=access
Rate limit apt-get to 42KB/s
 echo 'wget url' | at 01:00Download url at 1AM to current dir
#apache2ctl configtest && apache2ctl gracefulRestart apache if config is OK
nice openssl speed sha1Run a low priority command (openssl benchmark)
chrt -i 0 openssl speed sha1Run a low priority command (more effective than nice)
renice 19 -p $$; ionice -c3 -p $$Make shell (script) low priority. Use for non interactive tasks
Interactive monitoring
watch -t -n1 uptimeClock with system load
htop -d 5Better top (scrollable, tree view, lsof/strace integration, ...)
iotopWhat's doing I/O
#watch -d -n30 "nice ps_mem.py | tail -n $((${LINES:-12}-2))"What's using RAM
#iftopWhat's using the network. See also iptraf
#mtr www.pixelbeat.orgping and traceroute combined
Useful utilities
pv < /dev/zero > /dev/nullProgress Viewer for data copying from files and pipes
wkhtml2pdf http://.../linux_commands.html linux_commands.pdfMake a pdf of a web page
timeout 1 sleep 3run a command with bounded time. See also timeout
Networking
python -m SimpleHTTPServerServe current directory tree at http://$HOSTNAME:8000/
openssl s_client -connect www.google.com:443 </dev/null 2>&0 |
openssl x509 -dates -noout
Display the date range for a site's certs
curl -I www.pixelbeat.orgDisplay the server headers for a web site
#lsof -i tcp:80What's using port 80
#httpd -SDisplay a list of apache virtual hosts
vim scp://user@remote//path/to/fileEdit remote file using local vim. Good for high latency links
curl -s http://www.pixelbeat.org/pixelbeat.asc | gpg --importImport a gpg key from the web
tc qdisc add dev lo root handle 1:0 netem delay 20msecAdd 20ms latency to loopback device (for testing)
tc qdisc del dev lo rootRemove latency added above
Notification
echo "DISPLAY=$DISPLAY xmessage cooker" | at "NOW +30min"Popup reminder
notify-send "subject" "message"Display a gnome popup notification
 echo "mail -s 'go home' P@draigBrady.com < /dev/null" | at 17:30Email reminder
 uuencode file name | mail -s subject P@draigBrady.comSend a file via email
 ansi2html.sh | mail -a "Content-Type: text/html" P@draigBrady.comSend/Generate HTML email
Better default settings (useful in your .bashrc)
#tail -s.1 -f /var/log/messagesDisplay file additions more responsively
seq 100 | tail -n $((${LINES:-12}-2))Display as many lines as possible without scrolling
#tcpdump -s0Capture full network packets
Useful functions/aliases (useful in your .bashrc)
md () { mkdir -p "$1" && cd "$1"; }Change to a new directory
strerror() { python -c "import os; print os.strerror($1)"; }Display the meaning of an errno
plot() { { echo 'plot "-"' "$@"; cat; } | gnuplot -persist; }Plot stdin. (e.g: • seq 1000 | sed 's/.*/s(&)/' | bc -l | plot)
hili() { e="$1"; shift; grep --col=always -Eih "$e|$" "$@"; }highlight occurences of expr. (e.g: • env | hili $USER)
alias hd='od -Ax -tx1z -v'Hexdump. (usage e.g.: • hd /proc/self/cmdline | less)
alias realpath='readlink -f'Canonicalize path. (usage e.g.: • realpath ~/../$USER)
ord() { printf "0x%x\n" "'$1"; }shell version of the ord() function
chr() { printf $(printf '\\%03o\\n' "$1"); }shell version of the chr() function
Multimedia
DISPLAY=:0.0 import -window root orig.pngTake a (remote) screenshot
convert -filter catrom -resize '600x>' orig.png 600px_wide.pngShrink to width, computer gen images or screenshots
 mplayer -ao pcm -vo null -vc dummy /tmp/Flash*Extract audio from flash video to audiodump.wav
 ffmpeg -i filename.aviDisplay info about multimedia file
ffmpeg -f x11grab -s xga -r 25 -i :0 -sameq demo.mpgCapture video of an X display
DVD
 for i in $(seq 9); do ffmpeg -i $i.avi -target pal-dvd $i.mpg; doneConvert video to the correct encoding and aspect for DVD
 dvdauthor -odvd -t -v "pal,4:3,720xfull" *.mpg;dvdauthor -odvd -TBuild DVD file system. Use 16:9 for widescreen input
 growisofs -dvd-compat -Z /dev/dvd -dvd-video dvdBurn DVD file system to disc
Unicode
python -c "import unicodedata as u; print u.name(unichr(0x2028))"Lookup a unicode character
uconv -f utf8 -t utf8 -x nfcNormalize combining characters
printf '\300\200' | iconv -futf8 -tutf8 >/dev/nullValidate UTF-8
printf 'ŨTF8\n' | LANG=C grep --color=always '[^ -~]\+'Highlight non printable ASCII chars in UTF-8
fc-match -s "sans:lang=zh"List font match order for language and style
Development
gcc -march=native -E -v -</dev/null 2>&1|sed -n 's/.*-mar/-mar/p'Show autodetected gcc tuning params. See also gcccpuopt
for i in $(seq 4); do { [ $i = 1 ] && wget http://url.ie/6lko -qO-||
./a.out; } | tee /dev/tty | gcc -xc - 2>/dev/null; done
Compile and execute C code from stdin
cpp -dM /dev/nullShow all predefined macros
echo "#include <features.h>" | cpp -dN | grep "#define __USE_"Show all glibc feature macros
 gdb -tuiDebug showing source code context in separate windows
udev
udevadm info -a -p $(udevadm info -q path -n /dev/input/mouse0)List udev attributes of a device, for matching rules etc.
udevadm test /sys/class/input/mouse0See how udev rules are applied for a device
#udevadm control --reload-rulesReload udev rules after modification
Extended Attributes (Note you may need to (re)mount with "acl" or "user_xattr" options)
getfacl .Show ACLs for file
setfacl -m u:nobody:r .Allow a specific user to read file
setfacl -x u:nobody .Delete a specific user's rights to file
 setfacl --default -m group:users:rw- dir/Set umask for a for a specific dir
 getcap fileShow capabilities for a program
 setcap cap_net_raw+ep your_gtk_progAllow gtk program raw access to network
stat -c%C .Show SELinux context for file
 chcon ... fileSet SELinux context for file (see also restorecon)
getfattr -m- -d .Show all extended attributes (includes selinux,acls,...)
setfattr -n "user.foo" -v "bar" .Set arbitrary user attributes
BASH specific
echo 123 | tee >(tr 1 a) | tr 1 bSplit data to 2 commands (using process substitution)
 meld local_file <(ssh host cat remote_file)Compare a local and remote file (using process substitution)
Multicore
taskset -c 0 nprocRestrict a command to certain processors
find -type f -print0 | xargs -r0 -P$(nproc) -n10 md5sumProcess files in parallel over available processors
 sort -m <(sort data1) <(sort data2) >data.sortedSort separate data files over 2 processors

Linux Command Line Reference for Common Operations

By: Onlyone
13 December 2011 at 11:45

This is a linux command line reference for common operations.
Examples marked with • are valid/safe to paste without modification into a terminal, so
you may want to keep a terminal window open while reading this so you can cut & paste.
All these commands have been tested both on Fedora and Ubuntu.
See also more linux commands.
CommandDescription
apropos whatisShow commands pertinent to string. See also threadsafe
man -t ascii | ps2pdf - > ascii.pdfmake a pdf of a manual page
which commandShow full path name of command
time commandSee how long a command takes
time catStart stopwatch. Ctrl-d to stop. See also sw
dir navigation
cd -Go to previous directory
cdGo to $HOME directory
(cd dir && command)Go to dir, execute command and return to current dir
pushd .Put current dir on stack so you can popd back to it
file searching
alias l='ls -l --color=auto'quick dir listing
ls -lrtList files by date. See also newest and find_mm_yyyy
ls /usr/bin | pr -T9 -W$COLUMNSPrint in 9 columns to width of terminal
find -name '*.[ch]' | xargs grep -E 'expr'Search 'expr' in this dir and below. See also findrepo
find -type f -print0 | xargs -r0 grep -F 'example'Search all regular files for 'example' in this dir and below
find -maxdepth 1 -type f | xargs grep -F 'example'Search all regular files for 'example' in this dir
find -maxdepth 1 -type d | while read dir; do echo $dir; echo cmd2; doneProcess each item with multiple commands (in while loop)
find -type f ! -perm -444Find files not readable by all (useful for web site)
find -type d ! -perm -111Find dirs not accessible by all (useful for web site)
locate -r 'file[^/]*\.txt'Search cached index for names. This re is like glob *file*.txt
look referenceQuickly search (sorted) dictionary for prefix
grep --color reference /usr/share/dict/wordsHighlight occurances of regular expression in dictionary
archives and compression
gpg -c fileEncrypt file
gpg file.gpgDecrypt file
tar -c dir/ | bzip2 > dir.tar.bz2Make compressed archive of dir/
bzip2 -dc dir.tar.bz2 | tar -xExtract archive (use gzip instead of bzip2 for tar.gz files)
tar -c dir/ | gzip | gpg -c | ssh user@remote 'dd of=dir.tar.gz.gpg'Make encrypted archive of dir/ on remote machine
find dir/ -name '*.txt' | tar -c --files-from=- | bzip2 > dir_txt.tar.bz2Make archive of subset of dir/ and below
find dir/ -name '*.txt' | xargs cp -a --target-directory=dir_txt/ --parentsMake copy of subset of dir/ and below
(tar -c /dir/to/copy) | ( cd /where/to/ && tar -x -p )Copy (with permissions) copy/ dir to /where/to/ dir
(cd /dir/to/copy && tar -c .) | ( cd /where/to/ && tar -x -p )Copy (with permissions) contents of copy/ dir to /where/to/
(tar -c /dir/to/copy ) | ssh -C user@remote 'cd /where/to/ && tar -x -p'Copy (with permissions) copy/ dir to remote:/where/to/ dir
dd bs=1M if=/dev/sda | gzip | ssh user@remote 'dd of=sda.gz'Backup harddisk to remote machine
rsync (Network efficient file copier: Use the --dry-run option for testing)
rsync -P rsync://rsync.server.com/path/to/file fileOnly get diffs. Do multiple times for troublesome downloads
rsync --bwlimit=1000 fromfile tofileLocally copy with rate limit. It's like nice for I/O
rsync -az -e ssh --delete ~/public_html/ remote.com:'~/public_html'Mirror web site (using compression and encryption)
rsync -auz -e ssh remote:/dir/ . && rsync -auz -e ssh . remote:/dir/Synchronize current directory with remote one
ssh (Secure SHell)
ssh $USER@$HOST commandRun command on $HOST as $USER (default command=shell)
ssh -f -Y $USER@$HOSTNAME xeyesRun GUI command on $HOSTNAME as $USER
scp -p -r $USER@$HOST: file dir/Copy with permissions to $USER's home directory on $HOST
scp -c arcfour $USER@$LANHOST: bigfileUse faster crypto for local LAN. This might saturate GigE
ssh -g -L 8080:localhost:80 root@$HOSTForward connections to $HOSTNAME:8080 out to $HOST:80
ssh -R 1434:imap:143 root@$HOSTForward connections from $HOST:1434 in to imap:143
ssh-copy-id $USER@$HOSTInstall public key for $USER@$HOST for password-less log in
wget (multi purpose download tool)
(cd dir/ && wget -nd -pHEKk http://www.pixelbeat.org/cmdline.html)Store local browsable version of a page to the current dir
wget -c http://www.example.com/large.fileContinue downloading a partially downloaded file
wget -r -nd -np -l1 -A '*.jpg' http://www.example.com/dir/Download a set of files to the current directory
wget ftp://remote/file[1-9].iso/FTP supports globbing directly
wget -q -O- http://www.pixelbeat.org/timeline.html | grep 'a href' | headProcess output directly
echo 'wget url' | at 01:00Download url at 1AM to current dir
wget --limit-rate=20k urlDo a low priority download (limit to 20KB/s in this case)
wget -nv --spider --force-html -i bookmarks.htmlCheck links in a file
wget --mirror http://www.example.com/Efficiently update a local copy of a site (handy from cron)
networking (Note ifconfig, route, mii-tool, nslookup commands are obsolete)
ethtool eth0Show status of ethernet interface eth0
ethtool --change eth0 autoneg off speed 100 duplex fullManually set ethernet interface speed
iwconfig eth1Show status of wireless interface eth1
iwconfig eth1 rate 1Mb/s fixedManually set wireless interface speed
iwlist scanList wireless networks in range
ip link showList network interfaces
ip link set dev eth0 name wanRename interface eth0 to wan
ip link set dev eth0 upBring interface eth0 up (or down)
ip addr showList addresses for interfaces
ip addr add 1.2.3.4/24 brd + dev eth0Add (or del) ip and mask (255.255.255.0)
ip route showList routing table
ip route add default via 1.2.3.254Set default gateway to 1.2.3.254
host pixelbeat.orgookup DNS ip address for name or vice versaL
hostname -iLookup local ip address (equivalent to host `hostname`)
whois pixelbeat.orgLookup whois info for hostname or ip address
netstat -tuplList internet services on a system
netstat -tupList active connections to/from system
windows networking (Note samba is the package that provides all this windows specific networking support)
smbtreeFind windows machines. See also findsmb
nmblookup -A 1.2.3.4Find the windows (netbios) name associated with ip address
smbclient -L windows_boxList shares on windows machine or samba server
mount -t smbfs -o fmask=666,guest //windows_box/share /mnt/shareMount a windows share
echo 'message' | smbclient -M windows_boxSend popup to windows machine (off by default in XP sp2)
text manipulation (Note sed uses stdin and stdout. Newer versions support inplace editing with the -i option)
sed 's/string1/string2/g'Replace string1 with string2
sed 's/\(.*\)1/\12/g'Modify anystring1 to anystring2
sed '/ *#/d; /^ *$/d'Remove comments and blank lines
sed ':a; /\\$/N; s/\\\n//; ta'Concatenate lines with trailing \
sed 's/[ \t]*$//'Remove trailing spaces from lines
sed 's/\([`"$\]\)/\\\1/g'Escape shell metacharacters active within double quotes
seq 10 | sed "s/^/      /; s/ *\(.\{7,\}\)/\1/"Right align numbers
sed -n '1000{p;q}'Print 1000th line
sed -n '10,20p;20q'Print lines 10 to 20
sed -n 's/.*<title>\(.*\)<\/title>.*/\1/ip;T;q'Extract title from HTML web page
sed -i 42d ~/.ssh/known_hostsDelete a particular line
sort -t. -k1,1n -k2,2n -k3,3n -k4,4nSort IPV4 ip addresses
echo 'Test' | tr '[:lower:]' '[:upper:]'Case conversion
tr -dc '[:print:]' < /dev/urandomFilter non printable characters
tr -s '[:blank:]' '\t' </proc/diskstats | cut -f4cut fields separated by blanks
history | wc -lCount lines
set operations (Note you can export LANG=C for speed. Also these assume no duplicate lines within a file)
sort file1 file2 | uniqUnion of unsorted files
sort file1 file2 | uniq -dIntersection of unsorted files
sort file1 file1 file2 | uniq -uDifference of unsorted files
sort file1 file2 | uniq -uSymmetric Difference of unsorted files
join -t'\0' -a1 -a2 file1 file2Union of sorted files
join -t'\0' file1 file2Intersection of sorted files
join -t'\0' -v2 file1 file2Difference of sorted files
join -t'\0' -v1 -v2 file1 file2Symmetric Difference of sorted files
math
echo '(1 + sqrt(5))/2' | bc -lQuick math (Calculate φ). See also bc
seq -f '4/%g' 1 2 99999 | paste -sd-+ | bc -lCalculate π the unix way
echo 'pad=20; min=64; (100*10^6)/((pad+min)*8)' | bcMore complex (int) e.g. This shows max FastE packet rate
echo 'pad=20; min=64; print (100E6)/((pad+min)*8)' | pythonPython handles scientific notation
echo 'pad=20; plot [64:1518] (100*10**6)/((pad+x)*8)' | gnuplot -persistPlot FastE packet rate vs packet size
echo 'obase=16; ibase=10; 64206' | bcBase conversion (decimal to hexadecimal)
echo $((0x2dec))Base conversion (hex to dec) ((shell arithmetic expansion))
units -t '100m/9.58s' 'miles/hour'Unit conversion (metric to imperial)
units -t '500GB' 'GiB'Unit conversion (SI to IEC prefixes)
units -t '1 googol'Definition lookup
seq 100 | (tr '\n' +; echo 0) | bcAdd a column of numbers. See also add and funcpy
calendar
cal -3Display a calendar
cal 9 1752Display a calendar for a particular month year
date -d friWhat date is it this friday. See also day
[ $(date -d '12:00 +1 day' +%d) = '01' ] || exitexit a script unless it's the last day of the month
date --date='25 Dec' +%AWhat day does xmas fall on, this year
date --date='@2147483647'Convert seconds since the epoch (1970-01-01 UTC) to date
TZ='America/Los_Angeles' dateWhat time is it on west coast of US (use tzselect to find TZ)
date --date='TZ="America/Los_Angeles" 09:00 next Fri'What's the local time for 9AM next Friday on west coast US
locales
printf "%'d\n" 1234Print number with thousands grouping appropriate to locale
BLOCK_SIZE=\'1 ls -lUse locale thousands grouping in ls. See also l
echo "I live in `locale territory`"Extract info from locale database
LANG=en_IE.utf8 locale int_prefixLookup locale info for specific country. See also ccodes
locale -kc $(locale | sed -n 's/\(LC_.\{4,\}\)=.*/\1/p') | lessList fields available in locale database
recode (Obsoletes iconv, dos2unix, unix2dos)
recode -l | lessShow available conversions (aliases on each line)
recode windows-1252.. file_to_change.txtWindows "ansi" to local charset (auto does CRLF conversion)
recode utf-8/CRLF.. file_to_change.txtWindows utf8 to local charset
recode iso-8859-15..utf8 file_to_change.txtLatin9 (western europe) to utf8
recode ../b64 < file.txt > file.b64Base64 encode
recode /qp.. < file.qp > file.txtQuoted printable decode
recode ..HTML < file.txt > file.htmlText to HTML
recode -lf windows-1252 | grep euroLookup table of characters
echo -n 0x80 | recode latin-9/x1..dumpShow what a code represents in latin-9 charmap
echo -n 0x20AC | recode ucs-2/x2..latin-9/xShow latin-9 encoding
echo -n 0x20AC | recode ucs-2/x2..utf-8/xShow utf-8 encoding
CDs
gzip < /dev/cdrom > cdrom.iso.gzSave copy of data cdrom
mkisofs -V LABEL -r dir | gzip > cdrom.iso.gzCreate cdrom image from contents of dir
mount -o loop cdrom.iso /mnt/dirMount the cdrom image at /mnt/dir (read only)
cdrecord -v dev=/dev/cdrom blank=fastClear a CDRW
gzip -dc cdrom.iso.gz | cdrecord -v dev=/dev/cdrom -Burn cdrom image (use dev=ATAPI -scanbus to confirm dev)
cdparanoia -BRip audio tracks from CD to wav files in current dir
cdrecord -v dev=/dev/cdrom -audio -pad *.wavMake audio CD from all wavs in current dir (see also cdrdao)
oggenc --tracknum='track' track.cdda.wav -o 'track.ogg'Make ogg file from wav file
disk space (See also FSlint)
ls -lSrShow files by size, biggest last
du -s * | sort -k1,1rn | headShow top disk users in current dir. See also dutop
du -hs /home/* | sort -k1,1hSort paths by easy to interpret disk usage
df -hShow free space on mounted filesystems
df -iShow free inodes on mounted filesystems
fdisk -lShow disks partitions sizes and types (run as root)
rpm -q -a --qf '%10{SIZE}\t%{NAME}\n' | sort -k1,1nList all packages by installed size (Bytes) on rpm distros
dpkg-query -W -f='${Installed-Size;10}\t${Package}\n' | sort -k1,1nList all packages by installed size (KBytes) on deb distros
dd bs=1 seek=2TB if=/dev/null of=ext3.testCreate a large test file (taking no space). See also truncate
> filetruncate data of file or create an empty file
monitoring/debugging
tail -f /var/log/messagesMonitor messages in a log file
strace -c ls >/dev/nullSummarise/profile system calls made by command
strace -f -e open ls >/dev/nullList system calls made by command
strace -f -e trace=write -e write=1,2 ls >/dev/nullMonitor what's written to stdout and stderr
ltrace -f -e getenv ls >/dev/nullList library calls made by command
lsof -p $$List paths that process id has open
lsof ~List processes that have specified path open
tcpdump not port 22Show network traffic except ssh. See also tcpdump_not_me
ps -e -o pid,args --forestList processes in a hierarchy
ps -e -o pcpu,cpu,nice,state,cputime,args --sort pcpu | sed '/^ 0.0 /d'List processes by % cpu usage
ps -e -orss=,args= | sort -b -k1,1n | pr -TW$COLUMNSList processes by mem (KB) usage. See also ps_mem.py
ps -C firefox-bin -L -o pid,tid,pcpu,stateList all threads for a particular process
ps -p 1,$$ -o etime=List elapsed wall time for particular process IDs
last rebootShow system reboot history
free -mShow amount of (remaining) RAM (-m displays in MB)
watch -n.1 'cat /proc/interrupts'Watch changeable data continuously
udevadm monitorMonitor udev events to help configure rules
system information (see also sysinfo) ('#' means root access is required)
uname -aShow kernel version and system architecture
head -n1 /etc/issueShow name and version of distribution
cat /proc/partitionsShow all partitions registered on the system
grep MemTotal /proc/meminfoShow RAM total seen by the system
grep "model name" /proc/cpuinfoShow CPU(s) info
lspci -tvShow PCI info
lsusb -tvShow USB info
mount | column -tList mounted filesystems on the system (and align output)
grep -F capacity: /proc/acpi/battery/BAT0/infoShow state of cells in laptop battery
#dmidecode -q | lessDisplay SMBIOS/DMI information
#smartctl -A /dev/sda | grep Power_On_HoursHow long has this disk (system) been powered on in total
#hdparm -i /dev/sdaShow info about disk sda
#hdparm -tT /dev/sdaDo a read speed test on disk sda
#badblocks -s /dev/sdaTest for unreadable blocks on disk sda
interactive (see also linux keyboard shortcuts)
readlineLine editor used by bash, python, bc, gnuplot, ...
screenVirtual terminals with detach capability, ...
mcPowerful file manager that can browse rpm, tar, ftp, ssh, ...
gnuplotInteractive/scriptable graphing
linksWeb browser
xdg-open .open a file or url with the registered desktop application
© Jan 7 2008   [Comments] | [Add link to ...] |

Linux系统信息查看命令大全

By: Onlyone
13 December 2011 at 11:41

最近看了一些Linux命令行的文章,在系统信息查看方面学到不少命令。发现这些系统信息查看命令也可以总结出一篇小小的东西来了。

另外这里还有非常多的命令, 可以作为参考。


系统
# uname -a               # 查看内核/操作系统/CPU信息
# head -n 1 /etc/issue   # 查看操作系统版本
# cat /proc/cpuinfo      # 查看CPU信息
# hostname               # 查看计算机名
# lspci -tv              # 列出所有PCI设备
# lsusb -tv              # 列出所有USB设备
# lsmod                  # 列出加载的内核模块
# env                    # 查看环境变量
资源
# free -m                # 查看内存使用量和交换区使用量
# df -h                  # 查看各分区使用情况
# du -sh <目录名>        # 查看指定目录的大小
# grep MemTotal /proc/meminfo   # 查看内存总量
# grep MemFree /proc/meminfo    # 查看空闲内存量
# uptime                 # 查看系统运行时间、用户数、负载
# cat /proc/loadavg      # 查看系统负载
磁盘和分区
# mount | column -t      # 查看挂接的分区状态
# fdisk -l               # 查看所有分区
# swapon -s              # 查看所有交换分区
# hdparm -i /dev/hda     # 查看磁盘参数(仅适用于IDE设备)
# dmesg | grep IDE       # 查看启动时IDE设备检测状况
网络
# ifconfig               # 查看所有网络接口的属性
# iptables -L            # 查看防火墙设置
# route -n               # 查看路由表
# netstat -lntp          # 查看所有监听端口
# netstat -antp          # 查看所有已经建立的连接
# netstat -s             # 查看网络统计信息
进程
# ps -ef                 # 查看所有进程
# top                    # 实时显示进程状态
用户
# w                      # 查看活动用户
# id <用户名>            # 查看指定用户信息
# last                   # 查看用户登录日志
# cut -d: -f1 /etc/passwd   # 查看系统所有用户
# cut -d: -f1 /etc/group    # 查看系统所有组
# crontab -l             # 查看当前用户的计划任务
服务
# chkconfig --list       # 列出所有系统服务
# chkconfig --list | grep on    # 列出所有启动的系统服务
程序
# rpm -qa                # 查看所有安装的软件包

附加一张总结的很好Linux常用命定的图片:
Linux 文件结构大全

❌
❌